Part Number Hot Search : 
TDA9853 KAV16W V844ME 50RIA TPS830F HC367 216X7 M100GB1
Product Description
Full Text Search
 

To Download MC2DU128HACA Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  multimediacard tm 1 multimediacard s p ecification v e r s i o n : v e r . 0 . 9 date 4 ? june - 2004 samsung electronics co., ltd semico ndu ct or fla s h mem o ry prod uct plannin g & applicatio ns
multimediacard tm 2 rev i sion histor y rev i sion no. histo r y draf t d a te rem a r k 0.0 1. initial dra f t novem ber 2 9 th 2 0 0 1 p r e l i m i n a r y 0.1 1. cha nge d cs d filed 2. added comm and respon se t i ming 3. added spi bus t i mi ng march 15 th 20 0 2 p r e l i m i n a r y 0.2 1. added o r de ri ng informatio n (p age 6 ) 2. added po we r con s um ptio n (p age 1 3 ) jun e 21 st 200 2 p r e l i m i n a r y 0.3 1. cha nge d cs d field (p ag e 22) 2. cha nge d co mmand cla s s (p a ge 30 ) 3. added o perating ch ar acte ri stics (p ag e 1 4 ) novem ber 2 3 rd 2 0 0 2 p r e l i m i n a r y 0.4 1. cha nge d ord e rin g inform ation (p ag e 6) 2. cha nge d me mory array st ru cture (p age 9) 3. cha nge c_si ze and c_si ze_mul t ( p a ge 26 ) april 7 th 2003 advanced 0.5 1. cha nge d cs d inform ation (p a ge 22,2 3 ) 2. delete d p a ra gra p h s reg a rding st ream read an d p a rtial rea d /w rite april 26 th 2003 0.6 1. added dim e n s ion s of rs-mmc 2. added p r od u c t cod e of rs -mm c novem ber 1 2 th 2003 0.7 1. added p r od u c t cod e of mmc u s ing s3c4 9m8x0 1 cont rolle r 2. added p r od u c t cod e of pro g ram m abl e cid mmc u s ing s 3 c4 9m8x0 1 cont rolle r de cem ber 2 nd 2003 0.8 1. cha nge d co n t roller type for all kind s of mmc februa ry 16 th 2004 0.9 1. cha nge d pro duct mo del - ch ang ed fro m ?no lea d free? to ?le ad free? for nand fla s h pkg (p a ge 5, 6) 2. cha nge d cs d field (p a g e 23) 3. changed erase_gr p_s i ze (p age27) jun e 4 th 2004
multimediacard tm 3 1 intro ducti on t o the multi m ed ia card --- ---- --- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- 5 1 . 1 syste m fe atures --------------- ----- ---------- ----- ---------- ----- ---------- ----- ---------- ----- --------- 5 1 . 2 product model ------------ ------------------ ------------------- -------------- -------------- --------- 5 2 function description ------------------------- -------------- -------------- -------------- ------------ 7 2 . 1 flash t e chnology independen ce ----------- -- -------- ------ -------- ------ -------- ------ -------- --- 7 2 . 2 defect and error man ageme n t -- -------------------- ------------------ ------------------ ----------- 7 2 . 3 endur ance -------- ---- - ------ ----- --- ------ ----- --- ------ ----- --- ------ ----- --- ------ ----- --- ------ ----- - 7 2 . 4 a u tomatic s l eep mode -- -- -- -- ---- -- -- -- -- -- ---- -- -- -- -- -- ---- -- -- -- -- -- ---- -- -- -- -- -- ---- -- -- -- -- -- - 7 2 . 5 hot inser t ion - --- -- --- - --- --- -- --- --- --- --- -- --- --- --- --- -- --- --- --- --- -- --- -- - --- --- -- --- -- - --- --- -- --- - 8 2 . 6 multimediacard mode ------ ------- --------- ----- --------- ----- --------- ----- --------- ----- --------- -- 8 2 . 6 . 1 multimediacard s t andard comp liance ----- ------- ----- -- ------- ----- -- ------- ----- -- ------- ----- 8 2 . 6 . 2 negotiation operation conditions --- --- --- --- ---- --- --- --- - ---- --- --- --- - ---- --- --- --- - ---- --- --- - 8 2 . 6 . 3 card acquisition and identification ---------------------------------------------------------------- 8 2 . 6 . 4 card s t at u s ------- ---- - ------ ---- ---- ------ ---- ---- ------ ---- ---- ------ ---- ---- ------ ---- ---- ------ ---- -- 8 2 . 6 . 5 me mor y ar ray par t itioning -------- -------- ------ - -------- ------ - -------- ------ - -------- ------ - ------- 9 2 . 6 . 6 read and w r ite operati ons ----------------------------------- -------------------------------------- 9 2 . 6 . 7 dat a t r ans fer rate -------------- --- ------------ --- ------------ --- ------------ --- ------------ --- -------10 2 . 6 . 8 dat a prote c tion in the flash card ------ --- ------- ----- --- ------- ----- --- ------- ----- --- ------- ----10 2 . 6 . 9 erase --- -- -------------- -------------- -------------- -------------- -------------- -------------- ------------10 2 . 6 . 1 0 w r ite pr ot ection -- -- - --- -- --- -- --- - --- -- --- -- --- - --- -- --- -- --- - --- -- --- -- --- - --- -- --- -- --- - --- -- --- -- --- 10 2 . 6 . 1 1 copy bit -- ----------------------------------------------------------------------------------------------- 10 2 . 6 . 1 2 the csd register -- --------------- --------------- --------------- --------------- --------------- ------- 1 1 2 . 7 spi mode -------------- --------------------- --------------------- ------------------ -------------- ------- 1 1 2 . 7 . 1 neg o tia t ing op era t ion con d itio n s --- --- -- --- - --- --- -- --- -- - --- --- -- --- -- - --- --- -- --- -- - --- --- -- -- 1 1 2 . 7 . 2 card acquisition and identification ------ ---- -- ------ ---- ---- - ------ ---- ---- - ------ ---- ---- - ------ 1 1 2 . 7 . 3 card s t atus ------------ --------------------------------------------------------------------------------- 1 1 2 . 7 . 4 memory ar ray partitioning -------- --------------- --------------- --------------- --------------- ------ 1 1 2 . 7 . 5 read and w r ite oper ations ----- ------- ------ -- ------- ------ -- ------- ------ -- ------- ------ -- ------- - 1 1 2 . 7 . 6 dat a t r ans fer rate - - ---- --- ---- --- - ---- --- ---- --- - ---- --- ---- --- - ---- --- ---- --- - ---- --- ---- --- - ---- --- 1 1 2 . 7 . 7 dat a p r otection in the m u ltimediacard - - - --- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- 12 2 . 7 . 8 erase ------ ----------------------------------------------------------------------------------------------- 12 2 . 7 . 9 w r it e pro t ectio n - - - - - --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- - 1 2 3 product s p ecificat ions --- ---- --- ---- ---- --- --- - ---- ---- --- --- - ---- ---- --- --- - ---- ---- --- --- - ---- --- 13 3.1 recommen ded operating conditions ---------------------------- ---------------- ---------------- ------------- 13 3 . 2 op er atin g ch arac te ristis -- -- - --- -- -- -- -- -- --- -- -- -- -- -- --- -- -- -- -- -- --- -- -- -- -- -- --- -- -- - 14 3 . 3 syste m en vi ron m en t a l s p ecific ati ons - - - --- -- - --- -- -- --- -- -- - --- -- -- --- -- -- - --- -- -- --- -- -- - --- -- -- --- - 15 3 . 4 system re liability and maintenance --------- --------------- -------------------------------------- 15 3 . 5 physical s p ecifications - --- -- -- --- - --- -- --- -- -- -- - --- -- --- -- -- -- - --- -- --- -- -- -- - --- -- --- -- -- -- - --- -- -- 16 4 mu lti m e d ia card in terface desc ript ion --- - ---- --- --- --- -- ---- --- --- --- -- ---- --- --- --- -- ---- --- - 17 4 . 1 pin assignment s in multimedia c ard mode -------------- --------------- --------------- ----------- 17 4 . 2 pin a ssignment s in s p i mode -- --- --- -- --- -- -- --- --- -- --- -- -- --- --- -- --- -- -- --- --- -- --- -- -- --- --- -- 18 4 . 3 multi m edia c ard bus t opology -- -------- ----- -- -------- ----- -- -------- ----- -- -------- ----- -- -------- 18 4.4 spi bus t opology ---------------------- ---------------- ---------------- ---------------- ---------------- ------------ 19 4.4.1 spi interface concept ---------------- ---------------- ---------------- ---------------- ---------------- ----------- 19 4.4.2 spi bus t opology ---------------------- ---------------- ---------------- ---------------- ---------------- ---------- 19 4 . 5 r e gisters -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- - 20 4.5.1 operation condition register (ocr) -------------- ---------------- ---------------- ---------------- -------------20 4 . 5 . 2 car d identification (c id) -- --- -- -- - --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- -- --- --- -- --- -- -- --- --- -- --- 21
multimediacard tm 4 4 . 5 . 3 r e lative car d addr ess (r ca) --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- 21 4 . 5 . 4 c a r d s pecific d a t a (csd ) - - - - - ---- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- - 22 4 . 6 multimedia c ard co mmunication ------------ - ---------- ----- ---------- ----- ---------- ----- ---------- 30 4 . 6 . 1 co mman ds ---- --- --- --- ---- --- --- --- -- ---- --- --- --- -- ---- --- --- --- -- ---- --- --- --- -- ---- --- --- --- -- ---- --- 30 4 . 7 rea d , w r i t e an d eras e t i me- out co ndit i ons --- -- -- -- -- -- - --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- 33 4 . 8 c a r d identification m o de -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- - 34 4 . 8 . 1 op era t ing v o l t ag e ra nge v a li dat ion ------------- -------------------- ----------------- ------------- 35 4 . 9 d a t a t r ansfer mode -- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- - 3 5 4 . 9 . 1 block read ---------- -- --------- ------ --------- ------ --------- ------ --------- ------ --------- ------ -------- 37 4 . 9 . 2 block w r ite --------- --- --------------- --------------- --------------- --------------- --------------- -------- 37 4 . 9 . 3 eras e -- -- -- --- --- -- --- --- - --- --- -- --- --- - --- --- --- -- --- - --- --- --- -- --- - --- --- --- -- --- - --- --- --- -- --- - --- --- 38 4 . 9 . 4 w r ite prot e c t manag e m ent ---- --- ----- ---- ---- -- ----- ---- ---- -- ----- ---- ---- -- ----- ---- ---- -- ----- -- 38 4 . 9 . 5 card lock/ unlock op eration ---- ------ ----- ---- ------ ----- ---- ------ ----- ---- ------ ----- ---- ------ -- 3 8 4 . 9 . 6 res pons es ------------- --------------- --------------- --------------- --------------- ------------- --------- 41 4 . 9 . 7 s t atus ----- --------------- --------------- --------------- --------------- --------------- --------------- ------- 42 4 . 9 . 8 co mmand response t i min g --- -- ----- --- ---- --- ----- --- ---- --- ----- --- ---- --- ----- ---- --- --- ----- -- 44 4 . 9 . 9 rese t -- -- -- --- --- -- --- --- - --- --- -- --- --- - --- --- --- -- --- - --- --- --- -- --- - --- --- --- -- --- - --- --- --- -- --- - --- --- 48 4 . 1 0 spi comm unication - --- --- -- --- --- - --- --- -- --- --- - --- --- -- --- --- - --- --- -- --- --- - --- --- -- --- --- - --- --- - 49 4 . 1 0 . 1 mod e sel e ction -- --- -- ---- --- --- --- -- ---- --- --- --- -- ---- --- --- --- -- ---- --- --- --- -- ---- --- --- --- -- ---- --- 49 4 . 1 0 . 2 bus t r ansf e r protecti on ------ ---- ------- ---- ---- ------- ---- ---- ------- ---- ---- ------- ---- ---- ------- - 49 4 . 1 0 . 3 dat a read over view ---------- ----- ---------- ----- ---------- ----- ---------- ----- ----------- ---- ------- 50 4 . 1 0 . 4 dat a w r ite over view ------- ---- ---- ------- ---- ---- ------- ---- ---- ------- ---- ---- ------- ---- ---- ------- 5 1 4 . 1 0 . 5 erase and w r ite prot ect management -------------------- --------------- --------------- --------- 52 4 . 1 0 . 6 reading ci d/csd re gisters ----- ------- ------ -- ------- ------ -- ------- ------ -- -------- ----- -- ------- 53 4 . 1 0 . 7 reset sequence -- --- ----- ---- ---- -- ----- ---- ---- -- ----- ---- ---- -- ----- ---- ---- -- ----- ---- ---- -- ----- -- 53 4 . 1 0 . 8 error cond itions ---- -- ----- ---- --- --- ----- ---- --- --- ----- ---- --- --- ----- ---- --- --- ----- ---- --- --- ----- -- 53 4 . 1 0 . 9 me mory ar ray partitio ning --------------------- -- ------------- -- ------------- -- ------------- -- ------- 53 4 . 1 0 . 1 0 car d lock / unlock -- -- --- --- -- --- --- - --- --- --- -- --- - --- --- --- -- --- - --- --- --- -- --- - --- --- --- -- --- - --- --- - 53 4 . 1 0 . 1 1 co mman ds ---- --- --- --- ---- --- --- --- -- ---- --- --- --- -- ---- --- --- --- -- ---- --- --- --- -- ---- --- --- --- -- ---- --- 54 4 . 1 0 . 1 2 res pons es ------------- --------------- --------------- --------------- --------------- ------------- --------- 56 4 . 1 0 . 1 3 dat a t o ke ns ---- ---- -- ----- --- --- ---- ----- --- --- ---- ----- --- --- ---- ----- --- --- ---- ----- --- --- ---- ----- --- 5 8 4 . 1 0 . 1 4 dat a error t o ken ---- ----------------------------------------------------------------------------------- 59 4 . 1 0 . 1 5 clear i ng s t atus b i t s -- ---- -- --- --- --- ---- -- --- --- --- ---- -- --- --- --- ---- -- --- --- --- ---- -- --- --- --- ---- -- - 60 4 . 1 1 spi bus t i ming ----------------------------------------------------------------------------------------- 61 4 . 1 2 er ror hand ling - - - - - - - - - --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- -- -- --- -- -- -- -- --- - --- -- - 64 4 . 1 2 . 1 error correction code (ecc) ---- --------------- --------------- --------------- --------------- ------- 64 4 . 1 2 . 2 cyclic red undanc y check (crc) ---- ---- ---- ----- ---- --- --- ----- ---- --- --- ----- ---- ---- -- ----- --- 64
multimediacard tm 5 1 introduction to the multimediacard the multimediacard is a universal low cost data storage and communi cation media. it is designed to cover a wid e area of ap plicatio ns a s cellu la pho ne, electron ic toys, orga nizers, pda s , cameras, smart phones, dig i tal recorder s, mp3 players, pagers, etc. targ e ted features are high mobility and high performance at a low cost price. it might also be expressed in terms of low power consumptio n and high data thr oughput at t he memory card interface the multimediacard co mmunication is ba sed o n an adv anced 7-pin serial bus d e sig ned to oper ate in a low voltage range. the communication protocol is defined a s a part of t h is standard and referre d to as multimediacard mode. for compatibility to existing control l e rs the card s may offer, in addit i on to the multimediacard mode, an alternate communication protocol which is ba sed on the spi standard 1.1 sy stem fea tures - multimediacard syste m specificat ion ver.3.31 compatible - supports standard multimediacard bus - supports spi mode (single and multiple b l ock r ead and write operations) - supports block read/write - targeted for portable an d stationary applicat ions - maxi mum d a ta rate with up to 10 car d s - correction o f memory field errors - built-in write protection f eatures (per manent and temporary) - comfortable erase mechanism - 2.7 to 3.6 volts operation 1.2 product mo del table 1-1 multimediacard capacities (packing t y pe:bul k t y pe i) model num ber c a p a c i t i e s r e m a r k s mc56u032 ncf a-0 q c 0 0 3 2 m b mc12u064 nbf a -0qc0 0 6 4 m b mc1 g u128 naf a -0qc0 0 1 2 8 m b mc2du256 naf a -0qc0 0 2 5 6 m b mc2 g u512 n m c a - 0 q c 0 0 5 1 2 m b mc2 g u 0 1 g n m c a - 0 q c 0 0 1 g b . full size m m c . s3f49dax controller mc56u032 hcca-0 qc 0 0 3 2 m b mc12u064 haca-0 q c 0 0 6 4 m b mc1 g u128 haca-0 q c 0 0 1 2 8 m b mc1 g u256 haca-0 q c 0 0 2 5 6 m b . reduced-size mmc (rs-mmc) . s3f49dax controller
multimediacard tm 6 table 1-2 ordering info rmation m ( 1 ) c ( 2 ) x ( 3 ) x(4) x(5) x(6) x(7) x(8) x(9) x(10) x(1 1 ) x(12) ?( 13) x(14) x(15) x(16) x(17) x(18) (1) module : m (2) card : c (3) ~(4) : flash density 28 : 128mb 56 : 256mb 12 : 512mb 1g : 1gb 1d : 1gb ddp 2d : 2gb ddp (5) feature u : multimediacard (6) ~ (8) card density 016 : 16mb 032 : 32mb 064 : 64mb 128 : 128mb 256 : 256mb 512 : 512mb (9) card type n : standard multimediacard h : reduced-size multimediacard (10) flash generation m : 1 st gene ration a : 2 nd generation b : 3 rd generation c : 4 th gene ration d : 5 th gene ration (11) flash p a ckage c : chip y : tsop 1 v : wsop f : wsop(l ead free) (12) pcb revision a : none b : 1 st rev. c : 2 nd rev. (13) ? ?? (14) packin g type 0 : bulk type i 1 : bulk type ii (by white case) 2 : bulk type i (no label) 3 : bulk type ii (no label) 4 : bulk type i (only ba ck label) 5 : bulk type ii (only ba ck label) (15) controller q : s3f49dax (16) controller firmware revision a : none b : 1 st rev. c : 2 nd rev. d : 3 rd rev. e : 4 th rev. (17) ~ (18) customer grade ?customer list reference? the performance of the communication channel is descr ibed in the table below multimedia c ard mode spi mode three-wire serial data bu s (clock, co mmand, data) three-wire serial data bu s (clock, dat ain, dataout) + card specif ic cs signal up to 64k cards addressable by the bus protocol card selection via a hardware cs signal up to 30 cards stackable on a single physical bus card stacks require a ?p er card? cs signal easy identification and a ssignment o f session address to individual ca rds in a card stack not available. card sele ction via a h a rdware cs signal error-protected data tra n sfer optional. a non protecte d data transf e r mode is available single/multip le block rea d /write command single/multiple block re ad/write co mmands
multimediacard tm 7 2 function descripti on 2.1 flash technolog y ind ependence the 512 byte sector size of the multimediacard is the same as that in a n ide magn etic disk drive. to write or read a sector (or multiple sectors), the host computer software simply issue s a read or write command t o the multimediacard. this command contai ns the address and the n u mber of sectors to write/read. the host so f t ware then waits for the command to complete. the host so f t ware does not get involved in the details of how the flash memo ry is erased, programmed or read. this is extremely important as flash devices are expected to get more and more compl e x in the fu ture. because the multimediacard uses a n intel ligent on-board contro ller, t he host system software will n o t require changing a s new flash memory evolves. in other words, systems that support t he multimediacar d today will be able to access future multimediacards built with new flash technology without having to update or ch ange host software. 2.2 defect and error mana gement multimediacards cont ain a sophist icated d e fe ct and erro r management system. this syste m is analogous t o the syste m s found in magnetic disk driv es an d in many cases offers enhancements. for instance, disk drives do not typica lly perform a read after write to conf ir m the data is written cor r ectly because of the performance penalt y that woul d be incurred. multime d iacards do a read after write under margin condit i ons to verify that the data is written corre ctly (except in the case of a write withou t erase command). in th e rare case that a bit is f ound to be defective, multimediacards replace t h is bad bit with a sp are bit withi n the sector header. if necessary, multimediacards will even replace the entire sector with a spare se ct or. this is completely transparent t o the host a nd does not consume any user data space. the multimediacards soft error rate specif ication is much better than the magnetic disk driv e specification . in the extr emely rare case a r ead error does occur, mult imediacards have inno vative algorithms to recover t he data. this is similar to using retries on a disk drive but is much more sophist icate d . the last line of defense is to employ powerful ecc to correct the data. if ecc is used to recover data, defective bits are re placed with spare b i ts to ensure they do not cause any future problems. these defe c t and error management systems couple d with the solid-state constru c tion giv e multimediacards unparalleled reliability 2.3 endurance multimediacards have an endurance specif ica t ion for each sector of 1,000,000 writes (reading a logical sect or is unlimited). this is far bey ond what is needed in nearly all applicat ion s of multimediacards. even very hea vy use of t he multimediacard in cellu lar phones, personal communicators, pagers and voice r e corders will use only a fraction of the total en durance over the typical device?s f i ve year lifet ime. for instan ce, it would take over 100 years to wear out an area on the multimediacard on which a f iles of a n y size (fro m 512 bytes to capacity) was rewritt en 3 t i mes p e r hour , 8 hours a da y, 365 days per year. with typica l application s the endura n ce limit is n o t of any practical concer n to the vast majority of users. 2.4 automatic sleep mode
multimediacard tm 8 an important feature of the multimediacard is automatic e n trance and exit from sleep mode. upon completion of an operation, the mu ltimediacard will enter the sleep mode to co nserve power if n o further commands are received within 5 msec the host does not have to take any action for this to occur. in most systems, the multimediacard is in sleep m ode except when the h o st is accessing it, thus conser ving power. when the host is ready to access th e multimedi acard and it is in sleep mode, any comma nd issued to the multime d iacard will cause it to e x it sleep an d respond. the host do es not have to issue a reset f i rst. it may do this if d e sired, but it is not ne e ded. by not issu ing the reset, performance is improved through th e reduction of overhead. 2.5 hot insertio n support for hot insertio n will be re quired on t he host but will be sup ported through the con nector. connector manufacturers will provide connect o rs that hav e power pin s long enou gh to be po wered before contact is made with the ot her pins. please see connector data sheets for more detai ls. th is approach is similar to that used in pcmci a to allow for hot insertion. this applies t o both multimediacard and spi modes. 2.6 multimediacard mode 2.6.1 multimedia c ard stand ard compliance the multimediacard is f u lly complia nt with multimediacard standard sp ecificat ion v 3 .31. the structur e of the card specific d a ta (csd) register is co mpliant with csd structure v1.2. 2.6.2 negotiating operation conditions the multimediacard supports th e operatio n condit i on verificatio n sequence defined in th e multimediacard standar d specif ications. the multimediacard host sho u ld define a n operating voltag e range that is not suppo rted by the multimediacard. it will put itself in a n inactive st ate and ignore any bus commu nication. th e only way t o get the ca rd out of the inactive sta t e is by powering it down and up again. i n addition the host can explicitly send the card to the inactive st ate by usin g th e go_i n acti ve_state command. 2.6.3 card acqui sition and identification the multimediacard bus is a single master (mu l timedi acard host) and multi-slaves (cards) bu s. th e host can qu ery the bus and find o u t how many ca rds of which type are currently connecte d. the multimediacard?s cid register is pr e-programmed wi th a u n ique card identificat ion number which is used during the acquisition and ident ificatio n pro c edure in addition, the multimediacard host can read the card?s cid register u s ing the read_ci d multimediacard comma nd. the cid register is programmed during the multime d iacard test ing and formatting procedure, o n the manuf acturing f l oo r. the multimediacard host can only read this r egister and not write to it. 2.6.4 card statu s multimediacard status is stored in a 32 bit stat us register which is se nt as the da ta field in th e car d respond to host commands. status register provides information about the card?s current state and completion codes for th e last ho st command. the card st atus can be explicitly re ad (polled) with th e send_st a t us comma nd.
multimediacard tm 9 2.6.5 memory arra y pa rtitio ning although th e multimediacard me mory space is byte addressable with a ddresses ra nging from 0 to the last byte, it is not a simple byte array but divided into sev e ral structur es. memory bytes are grouped into 512 byte blocks called sectors. every block can be read, written individually. erase group is a number of sector s. its size is t he number of conse c utive sectors. any combination of erase group s can be e r ased in a single erase co mmand. a write command implicit ly erases th e memory bef ore writing new data into it. explicit erase comma nd can be used for pre-erasing of memory to speed up the next write operation. write protect groups (wpg) is the minimal uni ts that may have individual write protection. its size is the number of erase units that will be write protected by on bit. the wri t e/erase access to each wpg can be limited individually. the number of variou s memory st ructures, for the different multimediacards are summari zed in table 2-1 table 2-1 memory arra y structure b y t e s 3 2 m b 6 4 m b 1 2 8 m b 2 5 6 m b 5 1 2 m b 1 g b s e c t o r s 6 2 , 7 2 0 1 2 5 , 4 4 0 2 5 0 , 8 8 0 5 0 1 , 7 6 0 1 , 0 0 3 , 5 2 0 2 , 0 0 7 , 0 4 0 erase group 1 , 9 6 0 3 , 9 2 0 9 8 0 1 , 9 6 0 3 , 9 2 0 7 , 8 4 0 w p g 4 9 0 9 8 0 2 4 5 4 9 0 9 8 0 1 , 9 6 0 read and write operations the multimediacard sup ports two read/write modes. single block mode in this mod e the host reads or writes one data block in a pre-specif ie d length block transmission is protected with 16 bit crc which is generated by t he sending unit and checked by the receiving unit. misalignment is not allo wed. every data block must be contained in a single memory sector. the block length for write operation s must be identical to th e sector size and the start address aligned to a sector boundary. multiple bl ock mode this mode is similar to t he sing le block mode, b u t t he ho st can read/writ e multiple d a ta blocks ( a ll ha v e the same le ngth) which will be store d or retrieved from conti guous memory addresses starti ng at the address spe c ified in the command. the operation is terminated with a stop transmission co mmand. mi salignment and block lengt h restriction s apply to multiple b l ocks as well and are identical to the single block rea d /write oper ations. multiple block read with pre-defined block is sup ported. 2.6.6 data transfer rate the average data transfer rate for the multimediacard is 1 mbyte/sec for read and 300 kbyte/ sec for write (erase time is included) at 3.3 volts. in block mode, where time gaps can b e inserted b e tween data blocks, the maxi mum clock fre quency is 2 0 mhz. the typical acce ss time (late n cy) for each data block, in rea d operation, is 1.5ms. t he write blo ck operat ion is done in h andshake m ode. the ca rd will keep data line dat low as long as the write o peration is in progress and there are no write buffers available
multimediacard tm 10 2.6.7 data protec tion in the flash card every sector is protected with an error correct ion code (ecc). the ecc is generated (in the memory card) when t he sectors a r e written an d validated when the data is read. if defects are f ound, the da ta is corrected prior to transmission to the host. the multimediacard can be con s idered error free and no additio n a l data pro t ection is n eeded. however, if an application uses add itional, external, ecc protection, the data organization is def ined in the user writ eable sect io n of the csd register 2.6.8 erase the smallest erasable unit in the multimediacard is a erase group. in order to speed up the erase procedure, multiple era s e groups can be era s e d in th e sa me time. the erase ope ration is divided int o two stages. tagging - selecting the sectors for erasing to facilitate selection, a first command with the starting addr ess is follow ed by a second command wit h the final add ress, and al l erase grou ps within thi s range will be selected for erase. erasing - starting the erase proce ss tagging can address er ase groups. an arbitrary selection of erase group s may be erased at one time. tagging an d erasing must follow a strict com m and sequ ence (refer to the multimediacard standard specification for details). 2.6.9 write prote c tion the multimediacard erase groups are grouped into write p r otection gr oups. commands are provided for limiting a nd enabling write and er ase privileg e s fo r each group individually. the current write protect map can be read using send_w r i t e_prot c o mmand. in addition t w o, perman ent and temporary, card levels write protection o p tions are a v ailable. both can be set u s ing t he program_csd command (see below). the permanent write pr otect bit , once set, ca nnot be clea red. the one ti me progra m mable (ot p ) characteristic of the permanent writ e protect bit is implemented in the multimediacard con t roller firmware and not with a physical otp cell. 2.6.10 cop y bit the content of an multimediacard can be marked as an o r iginal or a copy using t he copy bit in th e csd register. once the copy bit is set (marked as a copy) it cannot be cleared. the copy bi t of the multimediacard is programm ed (during test and formatting on the manufacturing floor) as a copy. the multimediacard can be purchased with the copy bit set (copy) or cleared, indicating th e card is a master. the one time programmable (otp) characteristic of the co py bit is implemented in the multimediacard controlle r firmware a nd not with a physical otp cell. 2.6.11 the csd register all the configuration info rmation of the multimediac ard is st ored in the csd register. the msb bytes of the regist er contain man u facturer da ta and th e t w o least sig n ificant bytes conta i ns t he host con t rolle d data - the ca rd copy and write protection and the user ecc register.
multimediacard tm 11 the host ca n read the csd register and alter th e host contr o lled data b y tes using t he send_csd and program_csd commands. 2.7 spi mode the spi mode is a secondary (optional) communication protocol off e red for mu ltimediacard. this mode is a subset of t h e multimediacard protocol, designe d to communicate with an spi ch annel, commonly f ound in motorola?s (and lately a few other vendors?) microco n trollers. 2.7.1 negotiating operation conditions the operating condition negotiation function of t he multimed iacard bus is not suppo rted in spi mode. the host must work within the valid voltage range (2.7 to 3.6 volts) of the card. 2.7.2 card acqui sition and identification the card acquisitio n and identificat ion function of t he multimediacard bus is not supported in spi mode. the host must know the number o f cards curr ently connected on the bus. specif ic card sele ction is done via the cs signal. 2.7.3 card statu s in spi mod e only 16 bits (cont aining the er rors relevant to spi mode) can b e read out of the multimediacard status re gister. 2.7.4 memory arra y pa rtitio ning memory partitioning in spi mode is equivalent t o multimediacard mode. all re ad an d write commands are byte addressable. 2.7.5 read and write operations in spi mode , only single block read/ write mode is supported. 2.7.6 data transfer rate in spi mod e only block mode is su pported. th e typical access t i me (latency) for each data b l ock, in read operation, is 1.5ms. the write typical acce ss time (latency) for each data block, in read operation, is 1.5ms. t he write blo ck operat ion is done in handshake mode. the card will ke ep dataout line low as long as t he write operation is in p r ogress and there are no write buffers available. 2.7.7 data protec tion in the multimedia c ard same as for the multimediacard mode. 2.7.8 erase same as in multimediacard mode
multimediacard tm 12 2.7.9 write prote c tion same as in multimediacard mode
multimediacard tm 13 3 product specifications 3.1 recommended operati ng conditions the recommended op erating con d itions defin e the parameter rang es for optimal performance and durability of multimediacard. p a r a m e t e r s y m b o l m i n t y p m a x u n i t r e m a r k supply voltage vcc 2.7 3.0 3.6 v low-level input voltage v il v s s - 0 . 3 0 . 2 5 8 * vcc v inputs high-level input voltage v ih 0.625*vcc v c c + 0 . 3 v high-level output curre nt i oh - 2 m a outputs low-level output current i ol 6 m a clock frequ ency data transfe r mode(pp) f pp 0 2 0 m h z c l <100pf (10 cards) clock frequ ency ident. mode(od) f od 0 4 0 0 k h z clock cy cle tim e data transfe r mode(pp) t pp =1/f pp 5 0 n s clock cy cle tim e ident. mode(pp) t od =1/f pp 2 . 5 u s clock low time t wl 1 0 n s c l <100pf (10 cards) clock high t i me t wh 1 0 n s c l <100pf (10 cards) clock input r i se time t lh 1 0 n s c l <100pf (10 cards) clock input f a ll time t hl 1 0 n s c l <100pf (10 cards) clock low time t wl 5 0 n s c l <250pf (30 cards) clock high t i me t wh 5 0 n s c l <250pf (30 cards) clock input r i se time t lh 5 0 n s c l <250pf (30 cards) clock input clk*1 clock input f a ll time t hl 5 0 n s c l <250pf (30 cards)
multimediacard tm 14 3.2 operating characteris tics the operating characte ristics are p a rameters meas ured in a multimediacard system assuming th e recommend ed operating condition s. p a r a m e t e r s y m b o l m i n t y p m a x u n i t r e m a r k 3 2 m b 6 5 m a 6 4 m b 6 5 m a 1 2 8 m b 6 5 m a 2 5 6 m b 6 5 m a high speed supply current 5 1 2 m b 6 5 m a at 20mhz, 3.6v 3 2 m b 1 0 0 u a 6 4 m b 1 0 0 u a 1 2 8 m b 1 0 0 u a 2 5 6 m b 1 0 0 u a minimal supply current 5 1 2 m b 1 0 0 u a at 0hz, 3.6v standby state all digita l inputs (includin g i/o current) input leakag e current - 1 0 1 0 u a high-level output voltage v oh 0.75*vcc v at min i oh all outputs low-level output voltage v ol 0.125vcc v at ma x i ol input set-up time t isu 3 n s inputs: cmd, dat (referred to sclk), cs input hold time t ih 3 n s output set-up time t osu 5 n s outputs: cmd, dat (referred to clk), d0 (referred to sclk) output hold time t oh 5 n s a t t lh =10ns
multimediacard tm 15 figure 3-1 t i ming diagram of dat a input and output 3.3 sy stem en vironmental specifications temperature operating non-operating -25?c to 85?c -40 ?c to 85 ?c humidit y non-operating 8% to 95%. non-condensing acoustic noise 0 d b vibration operating non-operating 5 g peak to peak max. 5 g peak to peak max. shock operating non-operating 1,000 g ma x 1,000 g ma x 3.4 sy stem rel i ability and maintenance mtbf >1,000,000 hours preventive maintenance none data reliability < 1 non-recoverable error in 10 14 bits read endurance 1,000,000 write/erase cy cles
multimediacard tm 16 3.5 ph y s ical specifications dimensions of normal mmc(24 mm x 32mm x 1.4 mm) dimensions of rs-mmc ( 24mm x 18 mm x 1.4 m m)
multimediacard tm 17 4 multimedi acard interface description 4.1 pin assignments in multimediacard mode table 4-1 multimediacard pad definition pin no. name t y pe *1 description 1 r s v n c n o c o n n e c t i o n 2 c m d i/o/pp/ o d c o m m a n d / r e s p o n s e 3 v ss1 s g r o u n d 4 v cc s p o w e r s u p p l y 5 c l k i c l o c k 6 v ss2 s g r o u n d 7 d a t i / o / p p d a t a note : 1. s: p o we r supply; i: input; o: ou tput; pp: push-p u ll; od: o pen -drain; nc: no conn ection or v ih figure 4-1 multimedi acard mod e i/o drivers
multimediacard tm 18 4.2 pin assignments in spi mode table 4- 2 spi pad defi nition pin no. name t y pe *1 description 1 c s i c h i p s e l e c t 2 d i i d a t a i n 3 v ss s g r o u n d 4 v cc s p o w e r s u p p l y 5 s c l k i c l o c k 6 v ss2 s g r o u n d 7 d o o / p p d a t a o u t note : 1. s: p o we r supply; i: input; o: ou tput; pp: push-p u ll; od: o pen -drain; nc: no conn ection or v ih 4.3 multimedia c ard bus t opolog y the multimediacard bus has three communication lines an d four supply lines: - cmd: co mmand is a bi-directio n a l signal. host and card d r ivers are operating in tw o modes, open drain an d push pull. - dat: data is a bi-d irectional signal. host and card drivers are operating in push pull mode. - clk: clock is a ho st t o card signa l. clk operates in push pull mode. - vdd: vdd is the powe r supply line for all card s. - vss[1:2]: vss are two ground lines. figure 4-2 bus circuitry diagram the r od is switched on and off by the host synchronously to the op en-drain an d push-pull mode transition s . r dat and r cmd are pull-up resistor s protecting the cmd and the dat line again s t bus floating whe n no card is insert ed o r when all card drivers are in a hi-impedance mode. a constant current sour ce can re pla c e the r od by achieving a better p e rformance (constant slopes for the signa l
multimediacard tm 19 rising and fa lling edge s). if the host does not all o w the switchable r od implementation, a fix r cm d can be used. co nsequently t he maximu m operating implementation, a fix r cmd can be u s ed. conse quentl y the maximu m operating frequency in the open dr ain mode has to be redu ced in this case. 4.4 spi bus to polog y 4.4.1 spi interface concept the serial peripheral interface (spi) is a gen eral- purpose synchronous serial int e rface originally found on certain motorola micro-controlle r s. the multimediacard spi interfa c e is comp atible with spi hosts available on the market. as any ot her spi devic e the multimediacard spi channel consist s of the following 4 signals: - cs : host to card chip select signal - clk : host to card clo c k signa l - datain : host to card d a ta signal - dataout : card to host data signal another spi common characterist ic, which is implement ed in the multimediacard card as well, is byte transfers. all data token s are multiples of 8 bit b y tes and always byte a ligned to the cs signal. the spi standard defines the physical link o n ly and not the complete data transfer protocol. the multimediacard uses a sub s et of the multimediacard protocol an d command set . 4.4.2 spi bus t opology the multimediacard car d identif ication and addr essing algor ithms are re placed by h a rdware chip select (cs) signal. there are no broadca s t commands. a card (slave) is selected, for every co mmand, by asserting (a ctive low) th e cs signa l (see f i gure 4-3). the cs signal b u st is contin uously activ e for the duration of t he spi transaction (command, response and da ta). the only exception is card-prog r ammin g time. at this time the ho st can de-a ssert the cs signal wit hout affectin g the progra mming process. the bi-directio n a l cmd and dat lines are repla c ed by unidirectional da tain and da taout signa ls. this eliminates t he ability o f executing commands while data is being r ead or written and, th erefore, eliminates t he sequent ial and multi block read/ write operations. the s p i channel supports on ly single block read/ write. figure 4-3 spi bus system
multimediacard tm 20 4.5 registers table 4-3 multimediacard information registers n a m e w i d t h t y p e d e s c r i p t i o n ocr 32 programmed by the manufacturer. read only for user supported voltage range , card power up status bit cid 128 programmed by the manufacturer. read only for user card identification number, card individual nu mber for identificat ion. r c a 1 6 programmed d u r i n g initialization, not readable relative card address, local system address of a card, dynamically assigned by the host dur ing initial i zati on. csd 128 programmed by the manufacturer. partially programmable by the user card specific data, infor m ation about the card ope ration condit i ons. cid and rca are used f o r identifyin g and addre ssing mult imediacard. csd contains the card specific data record . this reco rd is a set of information fields t o define the operation conditions of the multimediacard. for the user the cid a nd the ocr are read only registers. they are read out by special commands (refer to ch apter ?commands?). th e rca registers are write only registers. unlike cid and csd, rca looses it s contents afte r powering down the card. its value is reassig ned in each initialization cycle. the multimediacard registers usage in spi mode is su mmarized in t able ?multimediacard regist ers in spi mode table 4-4 information registers in spi mode n a m e w i d t h (b y t e s ) a v a i l a b l e d e s c r i p t i o n ocr 4 yes operation condition register cid 16 yes card identification data ( s erial numb e r, manufacturer id etc.) r c a n o csd 16 yes card specific data, infor m ation about the card operation co nditions 4.5.1 operation condition register (ocr) this register indicates supported volt age range of multimediacards. it is a 32 bit wide register a nd for read only . t able 4-5 ocr fields
multimediacard tm 21 ocr slice field value note d31 card power up status bit (busy) 0 or 1 d[30-24] reserved 0 d23 3.5 ~ 3.6v 1 d22 3.4 ~ 3.5v 1 d21 3.3 ~ 3.4v 1 d20 3.2 ~ 3.3v 1 d19 3.1 ~ 3.2v 1 d18 3.0 ~ 3.1v 1 d17 2.9 ~ 3.0v 1 d16 2.8 ~ 2.9v 1 d15 2.7 ~ 2.8v 1 d14 2.6 ~ 2.7v 0 d13 2.5 ~ 2.6v 0 d12 2.4 ~ 2.5v 0 d11 2.3 ~ 2.4v 0 d 1 0 2 . 2 ~ 2 . 3 v 0 d9 2.1 ~ 2.2v 0 d8 2.0 ~ 2.1v 0 d7 1.65 ~ 1.95 v 0 d [ 6 - 0 ] r e s e r v e d 0 4.5.2 card identification (cid) this register contains th e card identification infor m ation used during the card identification proced ure. it is a 128 bit wide registe r , one-time programma ble by the provider. the cid is divided into eight slice s : t able 4-6 cid fields n a m e f i e l d w i d t h c i d - s l i c e manufacturer id *1 mid 8 [ 1 2 7 : 1 2 0 ] oem/application id oid 1 6 [ 1 1 9 : 1 0 4 ] product name pnm 4 8 [ 1 0 3 : 5 6 ] product revision prv 8 [ 5 5 : 4 8 ] product serial number psn 3 2 [ 4 7 : 1 6 ] manufacturing date mdt 8 [ 1 5 : 8 ] crc checksum crc 7 [ 7 : 1 ] not used, always 1 -- 1 [ 0 : 0 ] note: 1. the value of mid is 0x15.
multimediacard tm 22 4.5.3 relative card address (rca) the 16-bit relative card address register carries t he card add ress assign ed by the host during th e card identification . this addr ess is u s ed for the addressed ho st to card communication after th e card identification procedure. the default value of the rca registe r is 0x0001. the value 0 x 0000 is reserved to set all car d s in standby state wit h the command select_deselect_card ( c md7). the rca is programme d with the command set_rel ative_address (cmd3) during the initialization procedure. the content of this reg i ster is lo st aft e r power down. the default value is assigned when an internal rese t is applied by the power up detectio n unit of the multimediacard. 4.5.4 card specific data (csd) the card specific da ta register de scribes how to access the card co ntent. the csd defines card operating pa rameters like maxi mum data access time, data transfer spee d. table 4-7 csd field n a m e f i e l d width c sd-slice v a l u e t y p e csd structure c s d _ s t r u c t u r e 2 [ 1 2 7 : 1 2 6 ] 0 x 2 r e a d o n l y spec version spec_vers 4 [ 1 2 5 : 1 2 2 ] 0 x 3 r e a d o n l y reserved - - 2 [ 1 2 1 : 1 2 0 ] 0 x 0 rea d o n l y data read access- time-1 t a a c 8 [ 1 1 9 : 1 1 2 ] 0 ? 26 (1.5 ms ) rea d only data read access- time-2 in clk cy cles nac * 100) n s a c 8 [ 1 1 1 : 1 0 4 ] 0 ? 01 (10 0 cy cl es ) rea d only max. data transfer rate t r a n _ s p e e d 8 [ 1 0 3 : 9 6 ] 0 ? 2a (20m hz,max) rea d only card command classe s c c c 1 2 [ 9 5 : 8 4 ] 0 ? 0f 5 (cl a ss 0,2,4, 5, 6, 7) rea d only max. read d a ta block length read_b l_l e n 4 [ 8 3 : 8 0 ] 0 ? 9 ( 51 2 bytes) rea d only partial blocks for read allowe d read_b l_p a r t i a l 1 [ 7 9 : 7 9 ] 0x0(disable d ) rea d o n l y write block misalignment write_b l k _ m i s a l i g n 1 [ 7 8 : 7 8 ] 0x0(disable d ) rea d o n l y read block misalignment read_b lk_ m isalign 1 [77:77] 0x0 (di s a b led ) rea d only dsr imple m ented dsr_imp 1 [76:76] 0x0 (di s a b led ) rea d only reserved - - 2 [ 7 5 : 7 4 ] 0 x 0 rea d o n l y dev i ce size c _ s i z e 1 2 [ 7 3 : 6 2 ] *1 rea d only max. read c u rrent at v dd min vd d_r_curr _min 3 [ 6 1 : 5 9 ] *2 rea d only max. read c u rrent at v dd ma x vd d_r_curr _ m a x 3 [ 5 8 : 5 6 ] *2 rea d only max. write current at v dd min v d d _ w _ c u r r _ m i n 3 [ 5 5 : 5 3 ] *2 rea d only max. write current at v dd ma x v d d _ w _ c u r r _ m a x 3 [ 5 2 : 5 0 ] *2 rea d only
multimediacard tm 23 dev i ce size multiplier c_size_m u l t 3 [ 4 9 : 4 7 ] *3 rea d only erase group size erase_grp _ s i z e 5 [ 4 6 : 4 2 ] * 5 r e a d o n l y erase group size multiplier erase_grp _ m u l t 5 [ 4 1 : 3 7 ] 0 x 1 f r e a d o n l y write protect group size wp_g rp_si z e 5 [ 3 6 : 3 2 ] 0 x 3 rea d o n l y write protect group enable wp_g rp_e n a b l e 1 [ 3 1 : 3 1 ] 0 x 1 rea d o n l y manufacturer default ecc default_e c c 2 [ 3 0 : 2 9 ] 0 x 0 rea d o n l y write speed factor r2 w_fa ct o r 3 [ 2 8 : 2 6 ] 0 x 4 rea d o n l y max. write data block length write_b l k _ l e n 4 [ 2 5 : 2 2 ] 0 x 9 rea d o n l y partial blocks for write allowe d write_b l k _ p a r t i a l 1 [ 2 1 : 2 1 ] 0 x 0 rea d o n l y reserved - - 5 [ 2 0 : 1 6 ] 0 x 0 rea d o n l y file format group file_fo r m a t _ g r p 1 [ 1 5 : 1 5 ] 0 x 0 rea d / w r i t e copy flag(otp) c o p y 1 [ 1 4 : 1 4 ] 0 x 1 rea d / w r i t e permanent write protection perm_write_prote c t 1 [ 1 3 : 1 3 ] 0 x 0 rea d / w r i t e temporary write protection tmp_write _ prote c t 1 [ 1 2 : 1 2 ] 0 x 0 rea d / w r i t e / era s e file format file_fo r m a t 2 [ 1 1 : 1 0 ] 0 x 0 rea d / w r i t e ecc code e c c 2 [ 9 : 8 ] 0 x 0 r e a d / w r i t e / era s e crc c r c 7 [ 7 : 1 ] ? read/write/ era s e not used, always 1 0 [ 0 : 0 ] 0 x 1 rea d o n l y note s: 1. this field is depen ded o n the model. refer to also c_size_mul t 2. this field is depen ded o n the model 3. this field is depen ded o n the model. refer to also c_size 4. x means u s e r pro g ram m able 5. this field is depended on the model . refer to also erase_grp_size some of the csd fields are one-time or multiple programma ble by the customer or provider . all other field values are fixed. the follo wing sectio n describe s the csd fields and their values for multimediacards : csd register structure csd_st ru cture csd regist er structur e ?10? csd version no. 1.2 the csd ve rsion of these multimediacards is re lat ed to the ? m ultimediacard system specification , version 3.31?. the parameter csd_struct ure has permanently the value ?10?.
multimediacard tm 24 spec_v ers defines the spec version supported by the card. it include s t he comman d s set defin ition and the definition of the card responses. the card identif ication proce dure is com patible for all spec versio ns. spec_v ers s y stem spe cification version number ?0011? system spe c ificat ion version 3.31 the spec version of the s e samsung multimediacards is related to the ? m ultimediacard system specification , version 3.3 1 ?. the parameter spec_vers has permanently the value ?0011?. taac defines the asynchronous data access time: taac bit description values 2:0 time expon ent 0 = 1 ns, 1 = 10 ns, 2 = 100 ns, 3 = 1 ms, 4 = 10 ms, 5= 100 ms, 6 = 1 ms, 7 = 10 ms 6:3 time mantissa 0 = reserved, 1 = 1.0, 2 = 1.2, 3 = 1.3, 5 = 1.5, 5 = 2.0, 6 = 2.5, 7 = 3.0, 8 = 3.5, 9 = 4.0, a = 4.5,b = 5.0, c = 5.5, d = 6.0, e = 7.0, f = 8.0 7 r e s e r v e d a l w a y s ? 0 ? the value for the asynchronous dela y for these mult imediacards is 1.5 ms. the coded taac va lue is 0x26 (= 1.5 ms). nsac defines the worst case f o r synchronous data acce ss time. t he unit for nsac is 100-clock cycles. therefore, maxi mum value for the data access time is 25.6 k clock cycles. the total access time n ac as expressed in the table ?timing values? is the sum of both taac and nsac. it ha s to be computed by the host for actual clock rate. the read access time should be interprete d as a typical delay for the first data bit of a data block o r stream. the value of nsac for the s e multimediacards is 0 x 01 (100-clock cycles). for more details refer to chapter ?operating charact e ristics?. tran_s p e e d the followin g table defin es the maximum data transfer rate tran_speed: maximum data transfer rate defi nition tran_speed bit description values 2:0 transfer rat e exponent 0 = 100 kbit/ s , 1 = 1 mbit/s, 2 = 10 mbit/s, 3 = 100 mbit/s, 4...7 = reserved 6:3 time mantissa 0x0 = reserved, 0x1 = 1.0, 0x2 = 1.2, 0x3 = 1.3, 0x4 = 1.5, 0x5 = 2.0, 0x6 = 2.5, 0x7 = 3.0, 0x8 = 3.5, 0x9 = 4.0, 0xa = 4.5, 0 x b = 5.0, 0xc = 5.5, 0xd
multimediacard tm 25 = 6.0, 0xe = 7.0, 0xf = 8.0 7 r e s e r v e d a l w a y s ? 0 ? these multimediacards support a tr ansfer rate bet ween 0 and 20mb/s. the parameter tran_speed is 0x2a. ccc the multimediacard co mmand set is divided int o subsets ( c ommand classes). the card comman d class register ccc defines which command classes are suppor ted by this car d . a set ccc bit means that the corresponding comman d class is su pported. for command class def initio n refer to table ? command classes?. supported card com m and classes ccc bit supported card command classes 0 class 0 1 c l a s s 1 ? . . ? . . 1 1 c l a s s 1 1 these multimediacards support the command cla sses 0,2,4,5,6 and 7. the parameter ccc is permanently assigned t o the value 0x0f5. read_ blk _len the data blo ck length is computed as 2^ read_blk_ l en . data block length read_ b l k _ l e n b l o c k l e n g t h 0 2 0 = 1 byte 1 2 1 = 2 bytes ? . . ? . . 1 1 2 11 = 2,048 bytes 1 2 - 1 5 r e s e r v e d the value of the parameter read_blk_len is 0x09 (512 byt e s). read_ blk _ partial read_bl k _partial d e fines whet her partial bl ock sizes ca n be used in block read command. read_bl k _partial = 0 means that only the block size d e fined by read_bl o ck_len can be used for block- orinted data tr ansfer. read_blk_partial = 1 means that smaller blocks can be u s ed as well. the minimum block size will be equa l to minimum addressable unit (one byte). write_bl k_mis a lign defines if the data block to be written by one command c an be spread over more than one physical blocks of t he memory device. the size of the memory block is defined in write_blk_len.
multimediacard tm 26 write_bl k_misali g n is permanently assign ed to the value ?0?, signa ling that cro ssing physical block boundaries is not allowe d. read_ blk _ misali gn defines if th e data block to be read by one command can be spread over more than one physical blo ck of the memo ry device. the size of t h e data block is defined in read_bl k _len. read_blk_ m i salign = 0 signals t hat crossing physical blo ck boundarie s is not a llo wed. read_block_ m isalign = 1 signals that crossing ph ysical blo ck boundaries is allowed. t hese multimediacards d o not suppor t read block operat ions with bo undary crossing. the pa rameter read_blk_ m i salign is p e rmanently assigned to the value ?0?. dsr_i m p defines if th e configura b le driver st age option is integrated on the car d or not. if implemented a drive r stage regist er (dsr) must be imple m ented also. dsr_i m p d s r t y p e 0 no dsr i m p l emented 1 d s r imple m e n t e d the parameter dsr_imp is permanently assign ed to the value ?0?. c_size this parameter is u s ed to compute the card ca pacity. the card capa cit y is computed from the entrie s c_size, c_ size_mult and read_ b lk_len a s follows: memor y ca pacity = block nr* block_le n where blocknr = (c_size+1)*mult mult = 2 c_ si ze_mult+2 (c_size_mul t < 8) block_l e n = 2 read_blk_len , (read_blk_len < 12) the followin g table sho w s the card capacity for each model. c - s i z e c _ s i z e _ m u l t read_ b l k _ l e n card capac ity 0x7a7 3 9 3 2 m b y t e s 0xf4f 3 9 6 4 m b y t e s 0x3d3 6 9 1 2 8 m b y t e s 0x7a7 6 9 2 5 6 m b y t e s 0xf4f 6 9 5 1 2 m b y t e s 0 x f 4 f 7 9 1 g b y t e s vdd_r_ cu rr_mi n, v dd_w_cu rr_mi n the maxi mum supply current at the minimum su ppl y voltage vcc (2.7 v) is coded a s follows :
multimediacard tm 27 maximum suppl y cu rrent consumption at vcc = 2.7 v vdd_r_ curr_mi n / vdd_w_curr_mi n code for cu rrent consumption at 2.7 v 2:0 2:0 0 = 0.5 ma; 1 = 1 ma; 2 = 5 ma; 3 = 10 ma; 4 = 25 ma; 5 = 35 ma; 6 = 60 ma; 7 = 100 ma vdd_r_ cu rr_max, v dd_w_cu rr_max the maxi mum supply current at the maxi mum s uppl y voltage vcc (3.6 v) is coded as follows: maximum suppl y cu rrent consumption at vcc = 3.6 v vdd_r_ curr_max / vdd_w_curr_ max c ode for cu rrent consumption at 3.6 v 2:0 0 = 1 ma; 1 = 5 ma; 2 = 10 ma; 3 = 25 ma; 4 = 35 ma; 5 = 45 ma; 6 = 80ma; 7 = 200 ma c_size_mult this parameter is used f o r coding a f a ctor mult for computing the total d e vice size (r efer to ?c_size) the factor mult is defined as 2 c_size_mult+2 . eras e_grp_size the contents of this register are a 5 b it binary coded value, u s ed to calcu l ate the size of the eras able unit of these multimediacard. the size of the erase unit (also refe rred to as erase group in chapter ?memory array partitioning?) is determined by the erase _grp_siz e and the erase_grp_ mult entries of the csd size of erasable unit = (erase_ grp_size + 1) * (eras e _ g rp_ m ult + 1) the followin g table sho w s the size of erase gro up for each model. e r a s e _ g r p _ s i z e e r a s e _ g r p _ m u l t c a r d capac ity 0 x 0 0 x 1 f 3 2 m b y t e s 0 x 0 0 x 1 f 6 4 m b y t e s 0 x 7 0 x 1 f 128mbytes 0 x 7 0 x 1 f 256mbytes 0 x 7 0 x 1 f 5 1 2 m b y e s 0 x 7 0 x 1 f 1 g b y t e s eras e_grp_mult a 5bit binary coded val ue is used f o r calculat in g the size of the erasable unit of these multimediacards. the parameter erase_grp_ mult is permanently assigned to t he value 0x1f. see erase_ grp_size section for detailed description.
multimediacard tm 28 wp_grp_size the size of a write prot ection grou p. the co nt ent of th is r egister is a binary code d value defining the number of erase group. this parameter's value is 8, which means that a write prot ect group size is 128 kby t e. wp_gr p _e nable the value is set to ?1?, m eaning grou p write protection is ena bled. default_ ecc set by the card manufacturer and d e fines the e cc code, which is reco mmended t o use (e.g. t he device is tested for) . the value is set to ?0 ?, indicating th at no design a ted ecc is recommend ed. r2w_fact or defines the typical blo c k program time as a multiple of the r ead acce ss time. the following table defin e s the field for m at. r2w_fact or multiples of read access time 0 1 1 2 (write half as fast as r ead) 2 4 3 8 4 1 6 5 3 2 6 6 4 7 1 2 8 this parameter value is 4 for these multimediacards. write_bl k_len block length for write operation. see read_bl_ len for field coding. write_bl k_parti a l write_bl k_partial defines whether partial bl ock sizes can be used in blo ck wrtie co mmands. write_bl k_partial = 0 means t hat only the block size d e fined by w r ite_block_len can be used for block-ori n ted data transfer. write_blk_partial = 1 means that smaller blocks can be used as well. the minimum bl ock si ze will be equa l to minimum addressable unit (one byte). these multimediacards suppo rt partial block read. the parameter write_blk_partial is permanently assigned to the value ?0?. file_format_ g rp indicated th e selected group of file formats. this fie l s is r ead-only for rom. the usage of this fiels is
multimediacard tm 29 shown in ta ble ?file_fo rmats? cop y defines if th e contents a r e an origina l (= 0) or a copy (= 1). t he copy bit is a one time programmable bit , being set by the customer. perm_wri t e_prot e c t permanently protects the whole card conten t against o v erwriting or erasing ( a ll write an d erase commands f o r this card is a perma nently disabled) . this parameter is one-time programmable by the customer. the default value is ?0? (n ot protected ) . tmp_writ e_prot ect temporarily protects th e whole card content from being overwritten or erased (all write and erase commands f o r this card are tempora r ily disabled ). this parameter is pro g rammable by the customer. the default value is ?0? (not protected). file_format indicates th e file format on the card. this field is read-only for rom. the following for m ats are defined. file_format _grp file_for mat t y pe 0 0 hard disk-like file system with partitio n table 0 1 dos f a t (floppy-like) with boot sect or only (no partition table ) 0 2 universal file format 0 3 o t h e r s / u n k n o w n 1 0 , 1 , 2 , 3 r e s e r v e d ecc defines the ecc code that was u s ed for st oring data on the card. t h is fie l d is used by the host (or applicat ion) to decode th e user data. the followin g table defin es the field f o rmat. ecc ecc t y pe maximum number of correctable bits 0 none (default) none 1 b c h (542,5 1 2 ) 3 2 - 3 0 , 1 , 2 , 3 - the content provider or customer defines which kind of error correction may be used to protect th e contents of multimediacard. this value is progra mmable. crc7 the crc7 contains the check sum for the csd c ontent. the check sum is computed according to chapter ?cyclic redundancy check(crc)?.
multimediacard tm 30 4.6 multimedia c ard com m unication all communication between host a nd cards is c ontrolled by the host (master). the host sends commands and, depen ding on the command, receives a correspondin g response from the selected card. in this chapter t he commands to contr o l the multimediacard, the card r e sponses a nd the contents of t he status an d error field included in t he response s , are define d . 4.6.1 commands the comma nd set of th e multimediacard system is divided into classe s correspon ding to the t y pe of card. the multimediacard supports t he following command classes: table 4-8 command classes c l a s s c o m m a n d c l a s s description 0 1 2 3 4 7 9 10 12 13 class 0 15 basic calss 1 11 stream read (not suppor ted) 16 17 class 2 18 block read class 3 20 stream writ e (not suppo rted) 24 25 26 class 4 27 block write 32 33 34 35 36 37 class 5 38 erase (not support ed cmd 32 ~34 and 37 according to mmc syste m spec 3.31) 28 29 class 6 30 write protection class 7 42 lock card
multimediacard tm 31 class 0 is mandatory and support ed by all ca rds. it repre s ents the ca rd identif icat ion and initializatio n commands, which are in tended to h andle differ ent cards a nd card types on the same bus lin es. th e card command class ( ccc) is coded in the card specific data register of each car d , so that the host knows how to access th e card. ther e are four kinds of commands defined on the multimediacard bus: - broadcast commands (bc) sent on cmd line, no response. - broadcast commands with respon se (bcr) sen t on cmd line, response (all cards simultaneou sly) on cmd line - addressed (point-to-po int) commands (ac) sent on cmd line, response o n cmd line. - addressed (point-to-po int) data tra n sfer commands (adtc) sent on cmd line, re sp onse on cmd line, data transfe r on dat line. the comma nd transmission always starts with the msb. ea ch comman d starts with a start bit a nd ends with a crc command protection field followed by an end bit. the length of each command frame is fixed to 48 bits (2.4 us at 20 mhz): 0 1 bit5 ?. bit0 bit31 ?. bit0 bit6 ?. bit0 1 start bit host command argument crc*1 end bit the start bit is always ?0? in command frames (sent from host t o multimediacard). the ho st bit is always ?1? f o r comman d s. the co mmand field contain s the binary coded com m and numb e r. the argument depends on t he comman d (refer to table ?basic command s (class 0) and table ? b lock- oriented read comman d s (class 2)? ) . the crc field is defined in chapter ?cyclic r edundancy check (crc)?. the multimediacard sup ports the fo llowing multimediacard commands : table 4-8 detailed command description cm d i n d e x t y p e argume n t res p abbr ev iation command d escrip t i o n cm d0 bc [31:0] stuf f bit s ? go_idle_st a te res e ts all c a rd to idle stat e cm d 1 b c r [31:0] o c r without bu sy r3 send_ op_ c on d che c ks fo r ca rd s not su ppo rting the full ran ge of 2.0v to 3.6v. after receiving cm d1 the ca rd send s an r3 re sp onse (refer to c h ap te r ?r esp o n s e s ? ) . cm d2 bcr [31:0] stuf f bit s r2 all_send_ cid asks all card s in re ady sta t e to send the i r cid *1 numbe rs on cm d-li n e cm d 3 a c [31:16] rca [15:0] stuf f bit s r 1 s e t _ r e l a t i ve_a dd r assi gn s relati ve address to the card in identificatio n state. cm d 4 b c [31:16] d s r [15:0] stuf f bit s ? set_dsr prog ram s the dsr of all ca rd s in stan d-b y state. these sams ung multime d iacar d do not suppor t this command cm d 7 a c [31:16] rca [15:0] stuf f bit s r1 (only the sele ct ed ca rd) select/ deselect_card comm and to ggle s a ca rd betwe en the stand by and tran sfer st ates or between t he pro g ra mming and disco n n e ct state. in both ca se s t he ca r d is sel e ct e d by it s own relative ad dre ss while d e se lecting the p r i o r sele ct ed ca rd . a ddres s 0 d e sel e ct s all. cm d8 re serv e d cm d 9 a c [31:16] rca r 2 send_ cs d asks the ad dressed ca rd to send its ca rd -
multimediacard tm 32 [15:0] stuf f bit s spe c ific d a ta (cs d ) *2 on cmd-li ne. cm d 1 0 a c [31:16] rca [15:0] stuf f bit s r2 send_ cid asks the ad dressed ca rd to send its ca rd identificatio n (ci d ) on cm d-li ne. cm d1 1 a d t c [31:0] dat a add re ss r 1 r ead _d a t _u nt il _st o p reads data stream from the c a rd, s t arting at the given add re ss, until a stop_tra nsmission follows . these sams ung multime d iacar d do not suppor t this command cm d12 ac [31:0] stuf f bit s r1 o r r1b *3 st op_tra nsmiss ion termi nate s a rea d /write stream/multiple block op eration. whe n cm d12 i s used to terminate a read tra n sacti on the ca rd will re spo nd with r1. wh en it is used to sto p a write tra n sact ion the ca rd will re sp ond with r1b. cm d 1 3 a c [31:16] rca [15:0] stuf f bit s r1 send_s t a t us asks the ad dres sed ca rd to send its status regi ster. cm d14 re serv e d cm d 1 5 a c [31:16] rca [15:0] stuf f bit s ? g o _ i n ac t i ve _ s t a te sets the c a rd to inac tive s t ate in order to prote c t the ca rd sta c k agai nst comm uni cati ons b r e a kdo w n s . cm d 1 6 a c [31:0] b l o c k length r1 set_block len select s a blo ck le ngth (i n bytes) for all followin g blo c k co mman d s (re ad an d write). *4 cm d 1 7 a d t c [31:0] dat a add re ss r 1 r e a d _ s i n gle_bl ock rea d s a bl ock of the size selecte d by the set_block len comma n d . *5 cm d 1 8 a d t c [31:0] dat a add re ss r 1 r e a d _ m u l tiple_ block contin uou sly sen d blo c ks o f data until interrupted by a stop. cm d19 reserved cm d 2 0 a d t c [31:0] dat a add re ss r 1 w r i t e _ da t _ u n til _st o p write s data stream from the host, sta r tin g at the given add re ss, until a stop_tra nsmission follows . these sams ung multime d iacar d do not suppor t this command cm d21 ? cm d22 re serv e d cm d23 ac [31:16] set to 0 [15:0] numb e r of blocks r 1 s e t _ b l o c k _co u nt define s the n u mbe r of blocks whi c h a r e going to be transfe rred in the immedi ate d ly su cceedi ng multiple blo ck read o r write comm and. cm d 2 4 a d t c [31:0] dat a add re ss r1 write_b l o c k write s a blo c k of the size selecte d by the set_block len comma n d . *6 cm d 2 5 a d t c [31:0] dat a add re ss r 1 w r i t e _ m u l t iple_ block contin uou sly write s blo c ks of data until a stop_tra nsmission follows . cm d26 ad tc [31:0] stuf f bit s r1 prog ram_ cid prog rammi ng of the card id entification regi ster. thi s comm and i s only done o n c e per multim edi aca r d card. the ca rd h a s som e hardwa r e to preve n t this ope ratio n after the firs t programming. normally this comm and i s rese rved for th e manufa c turer. cm d27 ad tc [31:0] stuf f bit s r1 prog ram_ cs d prog rammi ng of the progra mmable bit s of the csd. cm d 2 8 a c [31:0] dat a add re ss r1b set_write_prot if the card ha s write prote c tion feature s , this comm and set s the write protection bit of the add re ssed group. the p r o pertie s of writ e prote c tion a r e code d in the ca rd spe c ific
multimediacard tm 33 data (wp_grp_size). cm d 2 9 a c [31:0] dat a add re ss r1b cl r_ write _ prot if the card provides write p r ote c tion feature s , this comm and cle a rs the write prote c tion bit of the addressed g r o up. cm d 3 0 a d t c [31:0] w r i t e prote c t dat a add re ss r1 (7) send_write_pr ot if the card provides write p r ote c tion feature s , this comm and a s ks the ca rd to sen d the stat us of the write prote c tion b i ts. *7 cm d31 reve rsed cm d 3 5 a c [31:0] dat a add re ss r 1 t a g_e r ase_gro up_st a r t sets the add ress of the first erase gro u p within a rang e to be sele ct ed for erase cm d 3 6 a c [31:0] dat a add re ss r 1 t a g_e r ase_gro up_en d sets the add ress of the last erase gro u p within a conti nuou s rang e to be sel e cte d for era s e. cmd38 ac [31:0] s t uf f bit s r1b erase er ases all previous ly s e lec t ed s e c t ors cm d42 ad tc [31:0] stuf f bit s r1b lock _u nl o c k used to set/reset the pa sswo r d or lock/unlo c k the ca rd. the si ze of the data block is set b y the set_block _len comm and. cm d55 a c [ 3 1 : 1 6 ] rca [15:0] stuf f bit s r1 app_cmd indicates to the card that the next com m and is an ap plication sp ecifi c co mmand rathe r than a stan da rd comma nd these sams ung multime d iacar d do not suppor t this command cm d 5 6 a d t c [31:1] stuf f bit s . [0]: rd/wr r1b gen_ cm d used eithe r to tran sfer a d a ta block to the ca rd or to get a data block from the ca rd for gene ral p u rp ose / appli c ati on sp ecifi c comm and s. t he si ze of the data block shall be set by the set_block _len comm a nd. these sams ung multime d iacar d do not suppor t this command note : 1. cid re giste r co nsi s t s of 128 bit s (st a rt ing with msb, it is precede d by an additi onal st art bit, end s with an end bit) 2. csd regi ster con s ist s of 128 bit s (st a rting with ms b, it is prece ded by an ad ditional st art bit, ends with an en d bit) 3. this comm and is in dicating the bu sy st atus of the m u ltimedia c a r d via the dat a chan nel. 4. the default block length i s as spe c ified in the csd. 5. the dat a transfe rred mu st not cros s a physical blo c k bou nda ry u n less rd_b l k _misalign is set in the csd. 6. the dat a transfe rred mu st not cro ss a physical bl ock boun da ry unless writ e_blk_misal ign is set in the csd. 7. 32 write p r ote c tion bit s (rep r e s entin g 32 write protect gro u p s st a r ting at the spe c ified a ddress followed by 16 crc bit s a r e tran sferred in a p a yloa d fo rmat via the dat a lin e. the last (le a st si gnif i ca nt ) bit of the prote c ti on bit s co rre sp ond s to the first addre s sed gro up. if the addre s se s of the last group s are out si de the valid rang e, then the co rre sp ondi n g write p r ote c tion bit s shall be set to ze ro . 4.7 read, write and erase time-out conditions the times a fter which a time-out co ndition for read/write/erase operations occurs are (card indepen- dent) 10 times longer th an the acce ss/program times for these operations given below. a card shall complete the command within this time period, o r give up an d return an error message. if the host does not get a r e sponse wit h in the def ined time-out it sh ould assume the card is not going to r e spon d anymore and try to recover (e.g. r e set the ca rd, power cycle, reject, etc.). the typical acce ss an d program times are defin ed as follow s
multimediacard tm 34 read the read access time is defined as the sum of t he two time s given by t he csd parameters taac and nsac (refe r to table ? c ard specif ic data (cs d )?). these card parameters define the typical delay between the end bit of the read command an d the start bit of the data block. t h is number is card dependent and shou ld be used by the ho st to calculate t h roughput a nd the maximal frequency for stream read. write the r2w_factor field in t he cs d is u s ed t o calculate t he typical block progra m time obtained by multiplying the read a ccess time by this fa ctor. it app lies to a ll write/erase command s (e.g. set(clear)_write_ prot ect, program_csd(ci d) and the block write co mmands). it should be used by the host to calculate thro ughput. erase the duratio n of an erase comman d will be (order of magnitude) the n u mber of sectors to be erased multiplied by the block w r ite delay. 4.8 card identification mod e all the data communication in the ca rd identificat ion mode uses only the command line (cmd). multimedia c ard state diagram (card identification mode) figure 4-2 multimediacar d state diag ram (card identific a tion mode) the host st arts the car d identification process in open drain mode with the identif ication clock rate f od
multimediacard tm 35 (generated by a push pull driver stage). the open drain driver stages on the cmd line allow th e parallel card operati on during ca rd identificat ion. after the bus is acti vated the ho st will reque st the cards to send their valid o peration con d itions with the comm and send_ op_cond (cmd1). since the bus is in open drain mode, as long as t here is more than one card with operating condit i ons restrict ions, the host gets i n the response to the cmd1 a ?wired or? operation condition restrictio ns of those cards. the host then must pick a common denominator for operatio n and notify the applica t ion that car d s with out of range parameters (from the h o st perspective) are connected to t he bus. incompatible cards go into inactive state (refer to also cha p ter ?operating voltage range valid ation?). the busy bit in t he cmd1 response can be used by a card to tell the host that it is still working on its power-up/reset procedu re (e.g. downloadin g the regist er information from me mory fiel d) and is not r eady yet for communication. in this case the host must repeat cmd1 un til the busy bit is cleare d . after an o perating mode is established, the host asks all cards fo r their uniq ue card ide n tificat i on (cid) number with the broadcast command all_send_cid (cmd2). all not a l rea d y identified cards ( i .e. t hose which are in read y state) simultaneously start send in g their cid numbers serially, while bit-wise monitoring t heir outgoing bitstrea m. those cards, whose outgoing cid bits do not match the correspo nding bits o n the command line in any one of the bit perio ds, stop sending their cid i m mediately and must wait fo r the nex t id entificat ion cycle (cards stay in the ready state). there should be only one card which successfully sends its full c i d-number t o the host. this card then goes into th e identification state. the host assigns to this card (u sing cmd3, set_relative_addr) a relative card a ddre ss (rca, sh orter than c i d), which w ill b e used t o address the card in f u ture communication (f a s ter than wit h the cid). once the rca is received the card transfers to the stand by state an d does not react to further identificat ion cycles. the card also switches the output drivers from the open-d r ain to the push-pull m ode in this state. the host repeat s the iden tification process a s long as it re ceives a response (cid) to its ident ification command (cmd2). when no card responds to this command, all car d s have be en identif ied . the time-out condit i o n to recogn ize this, is waiting for t he start bit f o r more than 5 clock pe riods after sending cmd2 4.8.1 operating voltage range validation the multime d iacard standards operating range validation is intended to support reduced voltage rang e multimediacards. the multimediacard support s the rang e of 2.7 v t o 3.6v sup p ly voltage. so th e multimediacard sends a r3 response to cmd1 which cont ains an ocr value of 0x80ff8000 if the busy flag is set to ?read y? or 0x00ff8000 if the busy flag is active (refe r to chapter ?response s ?). by omitting the voltage ra nge in the command, t he host can query the card stack and determine the common vo ltage range before sen d ing out-of- range cards into t he in active state . this bus query should be u s ed if th e ho st is able to select a co mmon voltage range or if a notif ication to the ap plicatio n of non usab le cards in t he stack is desired. aft e rwards, the host must choose a voltage for op eratio n and reissue cmd1 with this cond ition sending in compatible cards into the inactive state. 4.9 data transfer mode when in standby state, both cmd and dat lines are in the push-pull mode. as long as the con t ent of all csd re gisters is not known, the f pushpull clock rate is equal to the slow f opendrain cloc k rate . send_ csd (cmd9) allows the host to get the card specific data (csd register), e.g. ecc t y pe, block length, card storage cap a city, maxi mum clock rat e etc..
multimediacard tm 36 figure 4-3 multimedia c ard state diagram (data transfer mode) the comma nd select _ deselect_card (cmd7) is us ed to select one card and place it in the transfer state. if a previously selected card is in the transfer state its connect i o n with the host is released an d it will move back to th e stand-by state. only one card ca n be, at any time, in the transfer state. a selected card is respondin g the cmd7 , the desele c ted one does not respo nd to this co mmand. when cmd7 is sent including the reserved relative card address ?0x0000?, all cards transfer back to stand-by st ate. this command is used to identify new cards without resetting othe r already ac quired cards. card s to which an rca has already b een assign ed, do not respond to the identif ication command flow in this st ate. all the data communication in the data tr ansfer mode is conseq uently a point-to point communication betw een the host and the se lected card (using addr essed com m ands). all addresse d command s are ackno w ledged by a res ponse on the cmd line. all rea d command s (dat a is sent from the card via data lines) can be int e rrupted at any time, b y a stop command. th e data transfer will terminate and the card will stop or start workin g on the n e x t command . the dat b u s line signal level is high when no data is transmitted. a trans mitted data block consist s of a start bit (low), followed by a continuou s data strea m . the data str eam contain s the net pa yload data ( and error co rrection b i ts if an off-car d ecc is u s ed). the data str eam ends w i th an end b i t (high). the data tran smission is synchronous to the clock signal. the payload for block- oriented dat a transfer is preserved by a crc check sum (refer to chapter ?cyclic redundancy check (crc)?). 4.9.1 block read the basic unit o f d a ta transfe r is a blo ck whose maxi mum size is def ined in th e csd (read_ b lk_len). a crc is appended to the end of eac h block ensuring data transfer integrity. read_si n gle_bl ock (cmd17) starts a block read and after a complete transfer the card goes ba ck to transfer state. read_multi ple_block (cmd18) st arts a transfer of several consecut ive blocks. two types of multiple block read tra n saction s ar e defined (th e host can u s e either on e at any time): * open-ended multiple block read : the number of blocks fo r the read multiple blo ck operation is not
multimediacard tm 37 defined. th e card will continuously transfer d a t a blocks until a stop transmission command is received. * multiple block read with pre-define d block cou n t : the car d will transf e r the requested number of dat a blocks, terminate the transacti on and return to transfer st ate. s t op command is not required at the end of this type of multiple blo ck read, unless terminated with an error . in other to st art multiple block read with pre- defined b l o ck count, the host must use the set_block count command(cmd23) immediately preceding t he read_ m ul ti ple_ block(cmd18) command. otherwise this card will st art an op en-ended multiple block read which can be sto pped using the st op_tra n smi ssion command . 4.9.2 block write block write (cmd24 - 27) means that one or more blocks o f data are transferred from the host to the card with a crc appen ded to the e nd of each block by the host. a card supporting block write must always be able to accept a block of data defined by write_blk_len. if the crc fails, the card will indicate the failure on the dat line; the transferred data will be discarde d and not written and all further transmitted blocks ( i n multiple blo ck write mode) will be ignored. th e write operation will a l so be aborted if the host tries t o write over a write-protected area. in this case, however, th e card will set the wp_violation bit. programming of the cid and csd r egister d o e s not requir e a previou s blo c k length setting. the transferred data is also crc protected. the multimed iacard write operation follows som e speci a l rules: write_multiple_block(cmd25) starts a transfer of sev e ral consecutiv e blo cks. two ty pes of multiple blo ck write tra n saction s , identical to t he multiple block read, are defined (the host can use either on at any time) * open-ended multiple block writ e : the number of blocks for the write multiple b l ock operat ion is not defined. th e card will continuou sly accept a nd program dat a block until a sto p transmission command is received. * multiple block write with pre-defined block cou n t : the card will transfer the requested number of dat a blocks, terminate the tra n saction an d return to transfer st at e. s t op command is not required at the end of this type of multiple block w r ite, unless terminated with an erro r . in other t o st art multi p le block write with pre-defined blo ck count, the host must use the set_block count command(cmd23) immediately preceding t h e write_mul t i p le_ b lock(cmd25) command. otherwise this card will st art an op en-ended multiple block write which can be sto pped usin g th e st op_tra n smi ssion command . the host can abort writing at any ti me, within a multiple block operation regardless of the it s type. t r ansaction abort is done by sending the stop transmissio n command . if a multiple block write with predefined b l ock co unt is aborted, th e dat a in the remaining blocks is not defined. 4.9.3 erase the erasabl e unit is the erase group. erase group is measured in wri t e blocks w h ich are the basic writable unit s of th e car d . the size of the erase group is a card spe c ific parameter and def ine d in th e csd. the host ca n erase a contiguous r ange of erase group s. s t arting the erase proce ss is a thre e step s sequence. first the host defines the st a r t address of the range using the erase_ group_st ar t(cmd35) command, n e xt it defi nes the last address of the range using the
multimediacard tm 38 erase_ group_end( cmd36) command an d finally it st art s the erase process by issuing the erase(cmd38) command. the ad dress fie l d in the erase commands is an erase group address in byte unit s . the card will all lsb? s bel ow the eras e group size, ef fectively rounding the address d o wn to the erase group bound ary . if an erase command is received o u t of sequence, t he card shall set the erase_ seq_error bit in the st atus re gister and re set the whole sequence. if an out of sequence(neither of the erase comma nds, except send_st a t us) command received, the card shall set the erase_reset st atus bit in the st atus regist er , r e set the erase sequence and execute the last command. if the erase range inclu des write protected blocks, the shall be lef t int a ct and only the non-protected blocks shall be erased. the wp_erase_skip st atus bit in the st atus re gister sha ll be set. as describe d above for block write, the card will indicate tha t an erase is in progre s s by holding da t low the act ual erase time ma y be quite long, a nd the host may issue cmd7 to deselect the car d . 4.9.4 write prote c t management card data may be protected again s t either era s e or write. the entire card may be permanently write protected by the manufacturer or co ntent provider by setting the perman ent or temp orary write protect bits in the csd. portions of the data may be pro t ected (in un its of wp_grp_size se ctors as spe c ifie d in the csd), and the write protection may be changed by the applica t ion. the set_write_prot command sets the write protection of the addre ssed write-p r otect group , and the clr_write_prot command clears the write protection of the a ddr essed write- protect grou p. the send_write_ prot command is similar to a single b l ock read command. the card shall send a data block containing 32 write protect i on bits (rep r esenting 32 write protect groups sta r ting at the specified add ress) followed by 16 crc bit s . the address field in the write protect commands is a gr oup address in byte units. the card will ig n o re all lsb? s below the group size. 4.9.5 card lock/unlock ope r ation the passwo r d protectio n feature e nables the host to lo ck a card while providing a password, which later will be used for unl ocking th e card. the pa ssword and its si ze are kept in a 12 8-bit pwd and 8-bit pwd_len registers, respectively. these registe r s are non-volatile so th at a power c y cle will not erase them. locked cards respond to (an d execute) all commands in the "b asic" command class (class 0 ) and ?lock card? comma nd class. t hus the host is allowed to reset, init ialize, se lect , query for status, etc., but not to acce ss d a ta on the card. if the p a ssw ord was previously set (the value of pwd_len is not?0?) will b e locked aut omatically after power on. similar to the existing csd and cid register writ e commands the lock/u n lo ck command is availab l e in "transfe r state" only . this mean s that it do e s not include an address arg u ment and t he card has to be selected before using it. th e card lock/ unlock command h a s the structure and bus transactio n type of a regular sing le block writ e command . the transferred data block includes all t he required information of the com m and (password setting mode, pwd itself, card lo ck/un lock e t c.). t he following table de scr ibes the str u cture of th e command dat a block. t able 4-9 card lock dat a s t ructure b y t e # b i t 7 b i t 6 b i t 5 b i t 4 b i t 3 b i t 2 b i t 1 b i t 0 0 re se rved erase lock _ un lo ck cl r_ pwd set_ pwd 1 p w d _ l e n 2 ? pwd_len+1 pass word dat a
multimediacard tm 39 * era s e : 1 defines for ced erase operation (all other bits sh all be ?0 ?) an d only the cmd byte is sent. * lo ck /u nlo c k : 1 = locks the c a rd. 0 = unlock the card (note that it is v a lid to se t this bit tog e ther with se t_pwd but it is not a llo wed to set it together with clr_pw d). * clr_pw d : 1 = clears pwd. * set_pwd : 1 = set new password to pwd * pwd_len : defines th e following p a ssword len g th (in bytes). * pwd : the password (n ew or currently used dep ending on th e command). the data b l ock size sha ll be defined by the host before it se nds the card lock/ unlock command. this will allow different pa ssword sizes. the fol l owing para g raphs defi ne the various lock/un l ock command sequences:
multimediacard tm 40 * setting th e passw ord - select a card (cmd7 ) , if not previously select ed already - define t he block len g th (cmd16 ), given by t he 8bit card lock/un lock mode, the 8-bit passwor d size (in bytes), and the number of bytes of the new password. in case that a p a ssword replacement is done, the n the block size sh all co nsider that b o th passwor ds, the old a nd the new one, are sen t with the co mmand. - send card lock/unlock command with the app ropriate dat a block size on the data line including 16 bit crc. the data block shall indicate the mode (set _pwd), the length (pwd_len) and the password it self. in ca se that a password replacement is do ne, then t h e length value (pwd_len) shall includ e both pa sswords, the old and the new one, a nd the pwd field sha ll include t he old password (currently used) fo llowed by the new password. in case that the sent old password is not correct (not equal in size and content) then lock_unl ock_fail ed error bit will be se t in the sta t us regist er and the o l d passwor d password a nd its size w ill be saved in the pwd and pwd_len fields, re spectively. note that the password length regist er (pwd_l en) indicates if a password is curre ntly set. when it equals ?0? th ere is no pa ssword set. if the value of pwd_len is not equ al to zero th e card will lock itself after p o wer up. it is possible t o lock the card immediately in the current powe r session by set- ting the lock/unl ock bit (while setting t he p a ssword) or sending add itional command for ca rd lock. * reset the passw ord: - select a card (cmd7 ) , if not previously select ed already - define t he block len g th (cmd 1 6 ), given by the 8bit card lock/un lock mode, the 8bit passwor d size ( i n bytes), and the number of bytes of the currently used password. - send th e card lock/ unlock command with the appropriate data blo ck size on th e data line including 16 bit crc. the data block shall indicate the mode clr_pw d, the length (pwd_len) and the pa ssword (pwd) itself (lock/unl ock bit is don?t care). if the pwd and pwd_len content match the sent password a nd its size, t hen the cont ent of the pwd register is cleare d a nd pwd_len is set to 0. i f the passw ord is not co rrect then th e lock_unlock_fail ed error bit will be set i n the status register. * locking a card: - select a card (cmd7 ) , if not previously select ed already - define t he block len g th (cmd16 ), given by t he 8 bit card lock/un lock mode, the 8 bit passwor d size (in b y tes), and the number of bytes of the currently used passwor d. - send the card lock/un lock command with the appropriate data block size on the da ta line including 16 bit crc. the data bloc k shall indicate the mode lock, the length (p wd_len) a n d the passwor d (pwd) itself. if the pwd content equ als to the sent passwor d then the card will be locked and the card-lo cked status bit will be set in the status register. if the password is not correct then lock_unlock_failed error bit will be set i n the status register. no te that it is possibl e to set the password and to lock the card in the same sequence. in such case t he host shall perform all the required ste p s for setting the password (as described above) including the bit lock set whil e the new passwo r d command is sent. if the passwor d was pr eviously set (p wd_len is not ?0?), the n the card will be locked aut o m atically after power on reset. an a ttempt to lock a lo cked card or to lo ck a card that do es not have a password will fail and the lock_unlock_failed error bit will be set in
multimediacard tm 41 the status re gister. * unlocking the card: - select a ca rd (cmd7), i f not previously selected already. - define the block length (cmd16), g i ven by the 8 bit card lo ck/unlo ck mode, the 8 bit password size (in bytes), and the n u mber of by t e s of the cur r ently used password. - send the card lock/un lock command with the appropriate data block size on the da ta line including 16 bit crc. the data block shall indi cate the mode unlock, th e length (pwd_len) and the password (pwd) itself. if the pwd content equ als to the sent passwor d then the card will be u n locked an d the card-lo cked status bit will be cle a red in the status register. if the password is not correct the n the lock_unl ock_fail ed error bit will be set i n the statu s register. n o te that the unlocki ng i s done only for the current p o w er sessi on . as long a s the pwd is not clea red the car d will be lo cked automatically on the next power up. the only way to unlock t he card is b y clearing th e password. an attempt to u n lock an unl ocked card will fail and lock_unl ock_fail ed error bit will be set in the status regist er. * forcing erase: in case that the user for got the pa ssword (the pwd content ) it is po ssib l e to era s e all the card data content alon g with the pwd content. this operation is ca lled forced erase. - select a card (cmd7), if not previously selecte d already. - define th e block leng th (cmd16) to 1 byte (8bit card lo ck/ unlock command). sen d the card lock/un lock command with the appr opriate data block of on e byte on the data line including 16 bit crc. the d a ta block shall indicate the mode er ase (the erase bit shall be the only bit set). if the erase bit is not t he only bit i n the data fi eld then the lock_unl ock_fail ed error bit will be set in the st atus register and the era s e request is reje cted. i f the command was a c cepted then all the card content will be erased including the p w d and pwd_len re gister conte n t an d the locked card will get unlocked. an attempt to force erase on an unlocked card will fail and lock_unlock_failed error bit will be set in t he status re gister. * state tran sition summary table ?card state transition table ? defines th e card stat e transition s as a function of rece ived command 4.9.6 responses all response s are sent via command line (cmd), all data start s with the msb. table 4-10 format r1(response command) 0 0 bit5 ? bit0 bit31 ? bit0 bit6 ? bit0 1 st a r t bit ca rd comm and st atu s crc end bit the content s of the stat us field are described in chapter ?status format r1b (response command w i th busy signal):
multimediacard tm 42 r1b is ident ical to r1 with an option a l busy sign al transmitte d on the dat a line. the card may be com e busy after receiving these command s based on its state prior to the command reception format r2 (cid, csd register): response len g t h 136 bits. note: bit 127 down to bit 1 of cid a nd csd are transferred, the reserved bit [0] is re placed by the end bit table 4-11 format r2(cid, csd register) : response length 136 bits 0 0 bit5 ? bit0 bit127 ? bit1 1 st a r t b i t ca r d re serve d cid or csd regi s t e r inclu d ing inte rnal crc end bit format r3 ( o cr): resp onse length 48 bits. the ocr is sent a s a response to the c m d1 to signalize t he supported voltage rang e. the multimediacard supports the range from 2.7 v t o 3.6 v. re spectively the value of a ll bits of the ocr field of the multimediacard is set to 0x80ff8000. so the r3 frame of t he multimed iacard cont ains th e value 0x3f8 0ff8000ff if the card is ready and 0x3f00ff8000ff if the card is busy. table 4-12 ocr : resp onse length 50hz 0 0 bit5 ? bit0 bit31 ? bit0 bit6 ? bit0 1 st a r t bit ca rd re serve d ocr field re serve d end bit 4.9.7 status the respon se format r 1 contains a 32-bit field with the n a me card st atus. this f i eld is in ten ded to transmit sta t us informat ion which is stored in a loca l st atu s register o f each card to the host . the following ta ble defin es the statu s r egister structure. the t y pe and cle a r-condition field s in th e table are coded a s follows: - type: e: error bit. s: status bit. r: detected and set for t he actual co mmand resp onse. x : detected and set during comman d execution. the host must poll the card by sending status - clear condition: a : accordin g to the card state. b: always re lated to the previous co mmand. re ception of a valid com m and will cl ear it (with a delay of one command). c: clear by read.
multimediacard tm 43 table 4-13 status bit s i d e n t i f i e r t y p e v a l u e des c ription c l e a r condition 31 out _ of_ r a n ge er ?0? = no e r ror ?1? = er ro r the comm a nds arg u me nt wa s out of allowed rang e for this card . c 30 address_e r ror erx ?0? = no error ?1? = er ro r a misalig ned add re ss, whi c h di d not m a tch the blo ck l ength wa s use d in the comm and. c 2 9 b l o c k _ l e n _ e r r or er ?0? = no er ror ?1? = er ro r the tran sfe r red blo ck l eng th is not allo we d for this card or the num be r of transfe rre d bytes doe s n o t match the block len g th c 2 8 e r a s e _ s e q _ e r r or er ?0? = no er ror ?1? = er ro r an erro r in the sequen ce of era s e comm and s o c curred. c 27 erase_p a ram ex ?0? = no error ?1? = er ro r a n inv a lid select ion, se ct o r s or gr ou p s , f o r era s e. c 26 wp_viola ti on erx ?0? = not prote c ted ?1? = protecte d the comm a nd trie d to write a write prote c ted bl o ck. c 2 5 c a r d _ i s _ l o c k e d s x ?0? = car d unlock ed ?1? = card locked whe n set, sig nals that the ca rd is lo cke d by the host. a 2 4 l o c k _unl o c k_f a iled erx ?0? = no error ?1? = er ro r set whe n a seq uen ce or p a sswo rd e rro r has bee n d e tected i n lo ck/u n lo ck ca rd comm and o r it there was an attempt to acce ss a lo cked ca rd. c 23 com _ crc_ e rror er ?0? = no e r ror ?1? = er ro r the crc ch eck of t he previous comm and failed. b 2 2 i l l e g a l _ co mman d er ?0? = no er ror ?1? = er ro r comm and n o t legal for the cu rre nt st ate b 2 1 c a r d _ e cc_ f aile d ex ?0? = succ ess ?1? = failure ca rd intern al ecc wa s applie d but the co rre ction of dat a is faile d. c 19 error erx ?0? = no error ?1? = er ro r a general or an unkno wn erro r occu rre d duri ng the op eratio n. c 18 u n d e r run ex ?0? = no er ror ?1? = er ro r the card cou l d not sust ain dat a tran sfer in stre am re ad mode. c 17 overrun ex ?0? = no error ?1? = er ro r the card coul d n o t su st ai n dat a pro g ra mming in stream wri t e mode. c 1 6 c i d _ o v e r write/ csd_over writ e erx ?0? = no error ?1? = er ro r can b e eithe r one of the followin g erro rs : - the cid registe r is al ready written and can n o t be overwritten. - the rea d only section o f the csd doe s not match the card co ntent. - an attempt to reve rsecop y (set a s ori g i nal) or pe rman en t wp (unpro t ect) bit s wa s done. c 15 wp_erase_skip sx ?0? = not protec ted ?1? = protecte d only p a rtial a ddress sp a c e was era s e d due to existing wp blocks. c 1 4 c a r d _ e cc_ d isab led sx ?0? = en able d ?1? = di sabl ed the comma n d ha s bee n execute d wit hout usin g the inte rnal ecc. a 13 erase_res e t sr ?0? = c l eared ?1? = set an era s e seque nce wa s cl ea red b e fore executin g b e ca use an out of erase seq uen ce co mmand wa s receive d c 12:9 current_s t a t e sx 0 = idle 1 = re ady 2 = ident cu rre nt st ate of the card. b
multimediacard tm 44 3 = stby 4 = tran 5 = dat a 6 = rcv 7 = prg 8 = dis 9?15 = re se rved 8 eady_for_da t a sx ?0? = not ready ?1? = re ady co rre sp ond s to buf fer empty signalin g on the bus a 7 : 6 r e serve d perma n e n t l y 0 5 app_cmd sr ?0? = dis abled ?1? = en able d the ca rd wil l expect acmd or indi cation that the com m and ha s b een inte rp ret e d as acmd. c 4 r e serve d perma n e n t l y 0 3:2 re serve d for appli c ation sp ecific comm a nds 1:0 re serve d for manufa c turer test mode 4.9.8 command response timings all timing diagrams use the following schematics and abbreviations: s s t art bit (= ?0?) t t r ansmitter bit (host = ?1?, card = ?0 ?) p one-cycle pull-up (= ?1?) e end bit (=1) z high impedance st ate (- > = ?1?) d d a t a bit s * r e p e t i t i o n crc cyclic redundancy check bit s (7 bit s for command or response, 1 6 bit s for blo ck dat a) c a r d a c t i v e h o s t a c t i v e the dif f ere n ce betwee n the p-bit and z-bit is that a p-bit is active ly driven to high by t he card respectively host output driver , whil e z-bit is driven to (resp ectively kept) high b y t he pull-up resisto r s r cmd respectively r da t . actively driven p-bit s are less sensit ive to noise superposit io n. t i ming v a lues m i n m a x u n i t nc r 2 6 4 clo c k cy cle s ni d 5 5 clo c k cy cle s n a c 2 10*(t aac* f o p +1 00* nsac) clo ck cy cle s nr c 8 - - clo c k cy cle s nc c 8 - - clo c k cy cle s nw r 2 - - clo c k cy cle s ns t 2 2 clo c k cy cle s the host co mmand and the card response are clocked out with the rising edge of the host clo ck. the delay between host command and card response is ncr clock cycles. the following timing diagr am is relevant for host command cmd3 :
multimediacard tm 45 command response timing (identificat ion mode) there is ju st one z bit pe riod followe d by p bits pushed up by the respond ing card. th e following timing diagram is r e levalent for all host co mmands follo wed by a response, ex cept cmd1, c md2 and cmd3 : command response timing (data transfer mode) card identification and card operation conditions timing the card id entificat ion ( c md2) and card operation conditio n s (cmd1) ti ming are processed in t he open- drain mode. the card re sponse to th e host command st art s af ter exactly n id clock cy cles. identification timing (card identification mode) last card response - next host command t i ming af ter receivi ng the last card respon se, the host can st art the next command transmission af ter at least n rc clock cycles. this timing is rele vant for any host command. tming response end to next cmd start (dat a transfer mode) last host command - next host command t i ming af ter the last command has been sent, the h o st can contin ue sending the next co mmand af te r at lea s t n cc clock p e riods.
multimediacard tm 46 tming cmd n end to cmd n+1 start (all modes) in the case the cmdn command wa s a last iden tification co mmand (no more response sen t by a card), then the ne xt cmdn+1 command is allowed t o follow af t e r at lea s t ncc+136(th e length o f the r2 response) clock period s . dat a access timing dat a transmission st art s with the access time delay tac (whi ch correspo nds to nac), beginning f r om the end bit o f t he dat a ad dress command. the dat a transfe r stop s auto m atically in case of a d a t a block transfer or b y a transfer stop command. data read timing (data transfer mode) dat a transfer stop command timing the card da t a transmission can be stopped usin g the stop command. t he dat a transmission st o p s immediately with the end bit of the stop comman d . timing of stop command (cmd12, data transfer mode) single or multiple block w r ite the host select s one card for dat a write opera t ion by cmd7. the host set s the valid block length for block or ient ed dat a transfer by cmd16. the host transfe rs the dat a with cmd24 . the addre ss of the dat a block is determine d by the arg u ment of this command. this command is respo nded by the card on the cmd line as usual. the dat a transfer from t he host st art s nwr clock cycles af ter the card response was received. the write dat a have crc check bit s to allow the card to check the transferred dat a for transmission errors. the card sends the crc c heck information as a crc st atus to the host (on the dat a line). the c rc st atus cont ains the information if the write dat a transfer was non-erroneous (th e crc
multimediacard tm 47 check d i d n o t fail) or not . in the case of transmission error the card sends a negative crc s t atus (?101? bin) which forces the host to retransmit the dat a. i n the case of non-erroneous transmission the card sends a positive crc st atus (?010? bin) a nd st art s the dat a programming procedure. timing of the block write command if the card d oes not have any more f r ee dat a receive buf fer , t he card indicates it by p u lling down t he dat a line to low . the card st op s pulling down the dat a line as so on as at lea s t one recei v e buf fer for the defined dat a transfer blo ck length b e c omes free. this sig nalin g does not g i ve any information about the dat a write st atus. this in formation has to be polle d by the st atus polling co mmand. erase block timing the host must fir s t t a g the sector to erase. t he t agged sector(s) are erased in p a rallel by using the cmd35,36 cmd38. th e card busy signaling is also used for the indica tion of the card erase procedure duration. in this ca se th e end of th e card busy signaling also does mean that the erase of all t agged sectors ha s been finishe d . the host can (also) r equest the card to sen d the actua l card st ate using the cmd13.
multimediacard tm 48 4.9.9 reset go_i d le_st a te (cmd0) is the sof t ware reset command, which set s the multimed iacard into the idle s t ate independently of the current st ate. in the i nactive s t at e the multimediacard is not af fected by this command. af ter power-on the multimediacard is always in the idle s t ate. af ter power-on or co mmand go_i d le_st a te (cmd0) all output bus drivers of the multi m ediacard i s in a high-impedance st ate and the card will be initialize d with a default relative card address (?0x0001?). the host r uns the bus at th e identification clock rate f o d generated by a push-pull dr iver st age (refer to also cha p ter ?power on? for more det ails).
multimediacard tm 49 4.10 spi comm unication the spi mode consist s of a secondary communication protocol. t h is mode is a subset of the multimediacard protoco l , design ed t o communicate with a s p i channel, commonly f ound in motorola?s (and lately a few other vendors?) microcontrollers. the in terface is selected during the first reset command a fter power up (cmd0) and cannot be changed once the part is powered on. the spi standard d e fines the physical link only, a nd not the complete data tran sfer protocol. the multimediacard spi i m plementation uses a subset of the multimediacard protocol and comman d set. it is intende d to be used by s y stems which require a small number of card (typically one) and have lower data t r ansfer rate s (compared to multimediacar d protocol base d systems). from the application point of view, the adva n tage of the spi mode is the capa bility of usin g an off-the-shelf host, hence reducing th e design-in effort to minimum. the disadvantage is the lo ss of perfor m ance of the spi system vers us multimediacard (lower data transfer rate, fe wer cards, hardware cs per card etc.). while the multimediacard channel is based on command a nd data bitst r eams which are initiat e d by a start bit and terminated by a stop bit, the spi cha nnel is byte oriented. every comman d or data bl ock is built of 8-b i t bytes and is byte align ed to the cs signal (i. e . the length is a multiple of 8 clo ck cycles). similar to the multimediacard protocol, the spi messages consist of command, re sponse and data- block to ken s (refer to chapter ?commands? a nd c hapter ?responses? for a detailed descr iption). all communication between host and cards is cont rolled by the host (mas ter). the host starts every bus transaction by asserting the cs signal low. th e response behavior in the spi mo de differs fr om the multimediacard mode in the following three aspects: - the sele cted card alw a ys responds to the command. - an additio nal (8 bit) re sponse stru cture is u s e d - when the card encou nters a data retrieval problem, it will r e spond with an error response (which repla c es the expected data b l ock) rather t han by a time-out as in t he multimediacard mode. only single block read write operations are supported in spi mod e . in addition to the command response, e v ery data block sent to the card dur ing write op erations will be resp ond ed with a special data respon se token. a data block may be as b i g as one ca rd sector an d as small a s a sing le byte. 4.10.1 mode selec t ion the multime d iacard wakes up in th e multimediacard mode . it will enter spi mode if the cs signal is asserted (n egative) during the rece ption of the reset command (cmd0). if the card recognize s t hat the multimediacard mode is required it w ill not respo nd to the co mmand and remain in th e multimediacard mode. if spi mode is required the ca rd will switch to spi and respond wit h the spi mode r1 response . the only wa y to return t o the multimediacard mode is by entering the power cycle. in spi mode the multimediacard protocol state machine is n o t ob served. all t he multimediacard commands supp orted in spi mode are always available. 4.10.2 bus transfer protectio n ever y multi m ediacard token transferred on the bus is protected by crc bits. in spi mod e , the multimediacard offers a non protect ed mode which enable s systems built with reliable data links to exclude the hardware or firmware required for implement ing the crc generation and verification functions. in the non-protected mode the crc bits of the command, response and data tokens are stil l receiver. th e spi interf ace is init ialized in the non protect ed mode. the host can turn this op tion on and off using the crc_ on_ o ff command ( c md59). 4.10.3 data read overview
multimediacard tm 50 the spi mode suppor ts single a nd multiple block read operations (cmd17 a nd cmd18 in the multimediacard protocol). the main difference s p i and multimediacard modes is th at the data and th e response ar e both transmitted to the host on th e dataout signal. there f ore the car d response to th e stop_command ma y cut-short and replace t he last data block (refer t o figure ?read operation?). figure 4-4 single block read ope r ation figure 4-5 multiple bl ock read operation the basic unit of dat a transfer is a block whose maxi mum size is define d in the csd (read_bl_len). a 16-bit crc is appended to the end of each block ensur i ng dat a transfer integrity (also refer to chapter ?cyclic redundancy ch eck (crc)?) . cmd17 ( r ead_si n gle_bl ock) initiates a single block read. cm d18 (read_m ul tiple_block) st art s a transfer of sev e ral co nsecutiv e bl ocks. t w o ty pes of multiple block read transactions are defined (the host can use either one at any time): * open-end ed multiple block read the number of blocks f o r the read multiple block operati on is not defined. th e card willco n tinuously transfer dat a blocks until a stop tran smission co mmand is received. * multiple b l ock read with pre-defined block count the card will transfer t he requeste d number of dat a blocks, terminate the transa c tion and r e turn to transfer st at e. s t op command is not required at the end of this typ e of multiple block re a d , unless terminated with an erro r . in order t o st art a multiple blo c k read with p r e-defined block count, the host must use the set_block_count command (cmd23) immediately preceding the read_ m ul tiple_block (cmd18 ) command. otherwise the card will st art an o pen-ended multiple block read which can b e stopped u s ing the st op_transmissi on co mmand. the host can abort reading at any time, withi n a multiple block oper ation, regardless of the it s type. t r ansaction abort is don e by sending the stop tr ansmission command. in case of a dat a retrieval error , the card will not t r ansmit any dat a. instea d, a specia l dat a error token will be sent to th e host. figur e ?read op eration-dat a error? shows a dat a read operation which terminated
multimediacard tm 51 with an error token rathe r than a dat a block. figure 4-6 read operation ? data error 4.10.4 data write overview the spi mode support s single blo ck and multiple block write commands. upon reception of a valid write command (cmd24 or cmd25), the card will respond with a response token and will wait for a dat a block to be sent fr om the host. crc suf f ix, block length and st art address restrictions ar e identical to the read operation (see figure 4 6 ). if a crc error is det ected it will be reported in the dat a-response token and the dat a blo ck will not b e programmed. every dat a block ha s a prefix of ?s t a rt block? token (one byte). af ter a dat a block ha s b een received, the card will respond with a dat a-response to ken. if the d a t a block has been re ceived without errors, it will be pro g rammed. as long as th e card is bu sy programming, a continuous stream of busy tokens will be sent to the host (ef f ectively holding the dat a out line low). figure 4-6 single block w r ite operation in multiple block write operation the stop transmission will be done by sending ?s to p t r an? toke n instead of ?s t a rt block? token a t t he beginnin g of the next block. t w o types of multiple block write tra n saction s , ident ical to t he multiple block rea d , are defined (the host can use eit h er one at an y time): * open-end ed multiple block w r ite
multimediacard tm 52 the number of blocks f o r the write multiple bl ock operat i on is not d e fined. the card will co ntinuously accept and program dat a blocks until a ?s top t r a n ? token is r e ceived. * multiple b l ock w r ite w i th pre-de fined block count the card will accept the requested number of dat a bl ocks and terminate the transacti on. ?s top tran? toke n is not required at the en d of this typ e of multiple block write, unless terminated with an error . in order to st art a multiple block write with pre- defined block count the host must use the set_block_ c ount command (cmd23) immediately preceding t he write_mul t i p le_block (cmd25) co mmand. otherwise the card will st art an open-ended multiple blo ck write which can be stop ped using t he ?s to p tran? token. the host ca n abort writing at any time, within a multiple blo ck operation , regardless of the it s type. t r ansaction abort is don e by sending the ?s top tran? token. if a multiple b l ock write with pre-defin ed block count is ab o r ted, the dat a in the remaining blo c ks is not def ined. if the card detect s a crc error or a programmin g error (e.g. write protect violation, out of range, address misalignment, internal error , etc.) during a multiple b l ock write operation (both types) it will r eport th e failure in the dat a-respo n se token a nd ignore a n y further in coming dat a blocks. the host must t han abort the operatio n by sending the ?s top t r an? token. once the programming operation is completed (either succe ssfully or wit h an error), the host must check the result s of the programming (or t he cause of the error if already reported in the dat a-response token) using the s e nd_st a t us command (cmd13). if the host sends a ?s t op t r ans? to ken af ter th e card re ceived the last dat a block of a multip le blo c k operation wi th pre-defin ed number of blocks, it will be interp reted as the beginnin g o f an i llegal command and respond ed accordin gly . while the ca rd is busy , resetting the cs signal will not terminate the programming process. the card will release the dat a out line (tri-st a te) and contin u e with progr amming. if the card is r e selected b e fore the programmin g is fin i shed, the dat a ou t line will be forced back to low and a ll commands will be rej e cted. resetting a card (using cmd0) will terminate an y pending o r active pro g ramming operations. t h is may destroy the dat a format s on the card. it is in the r e sponsib ility of the host t o prevent it. 4.10.5 erase and write prote c t management the erase and write protect management procedures in t he spi mod e are identical to those of the multimediacard mode. while the ca rd is erasing or c hanging the write pr otection b i ts of the pred efined sector list, it will be in a busy stat e and ho ld the dataout line low. figure ?no data operations? illustrate s a ? no data? bus transaction with and without busy si gnaling. figure 4-8 ?no data? operation 4.10.6 reading cid/csd regi sters
multimediacard tm 53 unlike the multimediacard protocol (where the regi ster co ntents are sent as a command res ponse), reading the contents of t he csd and cid registers in spi mo de is a simple read-block transactio n . the card will respond with a standard response token (refer to figure ?read operation?) followed by a data block of 16 bytes suffixed with a 16 bit crc. t he data time out for the csd co mmand cannot be set to the card taac since this value is stored in the csd. there f ore the standard response timeout value (ncr ) is used for read latency of the csd register 4.10.7 reset sequence the multimediacard requires a defin ed reset seq uence. after power on reset or cmd0 (software reset) the card ent ers an idle state. at this state t he only legal host comman d is cmd1 (send_ op_ c ond) and cmd5 8 (read_ o cr). in spi mode, as oppos ed to multimediacard mode, cmd1 has n o operands a nd does not return the contents of the ocr register. inste ad, the host may use cmd5 8 (available in spi mode o n ly) to read t he ocr register. further more, it is in the re sponsibility of the host to refrain from accessing cards th at do not suppor t its voltage rang e. the usa ge of cmd58 is not restricted to the initia lizing phase o n ly, but can be issued at any time. t he host must poll the ca rd (by repeatedly sending cmd1) until the in-idle-state ? bit in the card response indicates ( b y being set to 0 ) that the car d completed its in itializat i on processes and is re ady for the next comma nd. the host must poll the card (by repeatedly sending cmd1) until the ?in-idle-state? bit in th e card respo n se indicate s (by being set to 0) that the card completed its in itialization proce sses and is ready for the next command. 4.10.8 error condi tions unlike the multimediacard protocol , in the spi mode the card will alwa ys respond to a comma nd. the response in dicates acceptance or rejection of the comman d . a comma nd ma y be rejected if it is not supported (illegal opcode), if the crc check failed, if it contained an illegal operand , or if it was out of sequence d u ring an era s e sequence. 4.10.9 memory arra y pa rtitio ning same as for multimediacard mode. 4.10.10 card lock/unlock usage of card lock and unlock com m ands in spi mode is identical to multimediacard mode. i n both cases the command re sponse is of type r1b. after the busy signal clears, the ho st should ob tain the result of the operation by issuing a get_status co mmand. please refer to chapter ?card lock/un lock operation? f o r details. 4.10.11 commands all the multimediacard commands are 6 bytes long. the co mmand tran smission a l ways starts with the left bit of the bitstring cor r esponding to the command codeword. all commands are pr otected by a crc. the comma nds and arg u ments are listed in tab le table 4-14 command bit position bit position [47] [46] [45:40] [39:8] [7:1] [0] wid t h (bit s) 1 1 6 32 7 1 v a l u e ? 0 ? ? 1 ? ?1? de scriptio n st a r t bit tran smissio n bit comm and in d e x arg u ment crc7 end bit
multimediacard tm 54 the followin g table pro v ides a det ailed de scription of the spi bus commands. the respon ses ar e defined in chapter ?responses?. the table ?comm ands and arguments? lists all multimediacard commands. a ?yes? in th e spi mode colon indica t e s that the command is supported in spi mode. with these restrictions, th e command class descript i on in the csd is still valid. if a command d oes no t require an argument, the value of this field should be set to zero. the reserved comman d s are reserved in multimediacard mode a s well. the binar y code of a comma nd is define d by the mn emonic symbol. as an example, the conten t of the co mm and index field is ( b inary) ?000 000? for cmd0 and ?100111? for cmd39. table 4-15 commands and argum ents cm d index spi mode argume n t res p abbr ev iation command d escrip tion cm d 0 y e s non e r 1 go_id le_st a te re sets the mu ltimedia c ard cm d 1 y e s non e r 1 send_ op_ c on d a ct ivates the card? s initialization p r oc ess . cm d 2 n o cm d 3 n o cm d 4 n o cm d 5 r e v e r s e d cm d 6 r e v e r s e d cm d 7 n o cm d 8 r e v e r s e d cm d9 y e s non e r1 send_ cs d asks the sele cted card to send its ca rd- s p e cif i c dat a ( c s d ) cm d 1 0 y e s non e r 1 send_ c i d asks the sele cted card to send its c a rd identification (cid) cm d1 1 n o cm d 1 2 n o cm d 1 3 y e s non e r 2 send_s t a t u s as ks the sele cted card to send its status regi ste r . cm d 1 4 r e v e r s e d cm d 1 5 n o cm d16 y e s [31:0] block length r1 set_blo ck len sele cts a bl ock length (in b y tes) for all followi n g block com m and s (re ad an d write). *1 cm d 1 7 y e s [31:0] dat a add re ss r 1 r e a d _ s i n g l e _ block rea d s a bl ock of the size selecte d by the set_blockle n comm and. *2 cm d 1 8 y e s [31:0] dat a add re ss r 1 r e a d _ m u l tiple _blo ck contin uou sly tran sfers data blocks from ca rd to host until inte rru pted by a stop co mmand o r th e req u e s ted nu mber of data blocks tran smitted. cm d 1 9 r e v e r s e d cm d 2 0 n o cm d21 ? cm d22 rev e r s e d cm d23 y e s [31:16] set to 0 [15:0] numb e r of blocks r 1 s e t _ b l o c k _co un t define s the n u mbe r of blocks whi c h a r e goi ng to be tran sferre d in the immedi ately exceedi ng multiple blo ck read o r write comm and. cm d 2 4 y e s [31:0] dat a add re ss r1b *3 write_b l o c k write s a blo ck of the size selecte d by the set_blockle n
multimediacard tm 55 comm and. *4 cm d 2 5 y e s [31:0] dat a add re ss r 1 w r i t e _ m u l t ipl e_block contin uou sly write s blo c ks of data until a ?stop tran ? to ken or the req u e s ted nu mber of blo cks re ceived. cm d 2 6 n o cm d27 y e s non e r1b prog ram_ csd pro g ra mming of the pro g ra mmabl e bits of the csd. cm d 2 8 y e s [31:0] dat a add re ss r 1 b s e t _ w r i t e _ prot if the card h a s write prote c tion feature s , this comm and set s the write p r ote c tion bit of the add re ssed group. the p r o pertie s of write prote c tion a r e cod ed in the ca rd spe c ific data (wp_grp _size). cm d 2 9 y e s [31:0] dat a add re ss r 1 b c l r_ write _ prot if the card h a s write prote c tion feature s , this comm and cle a rs the write p r ote c tion bit of the add re ssed group. cm d30 y e s [31:0] write p r ote c t dat a ad dress r 1 s e n d _ w r it e _ prot if the card h a s write prote c tion feature s , this comm and a s ks the ca rd to se nd the statu s of the write prote c tion bit s . *5 cm d 3 1 r e serv e d cm d 3 5 y e s [31:0] dat a add re ss r 1 t a g_e r a s e _ group_s t ar t sets the a d d r ess of the first erase gro up withi n a ran ge to be sele cted fo r e r a s e cm d 3 6 y e s [31:0] dat a add re ss r 1 t a g_e r a s e _ gro u p_e n d sets the a d d r ess of the last erase gro up withi n a contin uou s ran ge to be sel e cte d for erase cmd38 y e s [31:0] s t uf f bit s r1b erase eras es all previous ly s e lec t ed se ct or s cm d 3 9 n o cm d 4 0 n o cm d 4 1 r e serv e d cm d42 y e s [31:0] stuf f bit s r1b lock/ u nlo c k used to set/reset the pa sswo r d or lock/unlo c k the ca rd. the st ru cture of the data block is de scri b ed in cha p t e r ? c a r d lock/ u n lo ck ope ration ?. the si ze of the data block is defin ed by the set_block _len comm a nd. cm d43 ? cm d57 re serv e d cm d58 y e s non e r3 read_ o c r rea d s the o cr regi ster o f a card. cm d59 y e s [31:0] stuf f bit s [0:0] crc o p tion r 1 c r c _ o n _ o f f tu rns the crc option on or off. a ?1? in the crc option bit will turn the option on, a ?0? will turn it off. cm d 6 0 n o notes : 1. the default block length i s as spe c ified in the csd. 2. the dat a tran sferre d must not cross a physi ca l block bou nd ary unle s s read_blk_m isalign is set in t h e c s d . 3. r1b : r1 response with an optional trailin g busy signal. 4. the dat a tran sferre d must not cross a physi ca l block bou nd ary unle s s write_blk_m i salign is set in t h e c s d .
multimediacard tm 56 5. 32 write prote c tion bit s (re p re se nting 32 write prot e c t grou p s st a r ting at the sp ecifie d address) foll owe d by 16 crc bit s are transfe rred in a p a yload format via the dat a line. the last (lea st signifi cant) bit of the prote c tion bit s co rre spon d s to the first add re ssed group. if the ad dre s se s of th e last grou p s are out si de th e valid ran ge, then the corre s po ndin g write prote c tion b i t s sh all be se t to zero.
multimediacard tm 57 4.10.12 responses there are several types of response tokens. as in the multimediacard mode, all are transmitted msb first: * format r1 this respon se token is sent by the card after every comma nd with the exception of send_st atus commands. it is one byte long, and the msb is always set to zero. the other bits ar e error indications, an error being signaled by a ?1?. the structure of the r1 format is given in figure ?r1 response format?. the meaning of the flags is defined as f o llowing - in idle s t ate: the ca rd is in idle state and run n ing the init ializing process. - erase reset: an erase sequence was cleared before executing becau se an out of erase seque nce command was received. - illegal c o mmand: an illega l command code was detecte d. - communication crc error: th e crc check of the last command fa iled. - erase sequence error: an erro r in the sequ ence of erase command s occurred. - address error: a misalign ed ad dress, which did not match the block length, was used in the command. - parameter error: th e command?s argument (e.g. address, block leng th) was out of the allow ed range for t h is card. figure 4-9 r1 respon se format format r1b this respon se token is identical t o t he r1 format with the o p tional add it ion of the b u sy signal. the busy signal token can be any number of b y tes. a zero value indicat e s card is busy. a non-z e ro value indicates the card is r eady for the next comma nd. format r2 this respon se token is two bytes long and sent as a respo n se to the send_st atus command. the format is given in figure ?r2 response format?.
multimediacard tm 58 figure 4-10 r2 response format the first by te is id entical to the re sponse r1. the conte n t of the second byte is describe d in th e following: - erase param: an invalid select ion, sectors or groups, f o r erase. - write protect violation: the co mmand tried to write a write protecte d block - card ec c failed: card internal e cc was applied but faile d to correct t he data. - cc erro r: internal card controller error - error: a general or an unknown error occurr ed during th e operation. - write protect erase skip | lock/unlock command failed: this statu s bit has two functions overloaded. it is set wh en the host attempts to erase a writ e protected sector or if a sequence o r password error occurr ed during ca rd lock/un lo ck operation . - card is locked: set when the ca rd is locked by the user. reset when it is un locke d. format r3 this respon se token is sent by the card when a read_ o cr command is rece ived. the respon se length is 5 bytes (refer to figu re ?r3 response format?). the str u cture of th e first (msb) byte is id e n tical t o response type r1. the other four bytes contain the ocr re gister. figure 4-11 r3 response format
multimediacard tm 59 data response every data block writte n to the car d will be acknowl edged by a data response to ken. it is one byte long and has the following for m at: figure 4-11 data response the meaning of the stat us bits is def ined as follo w s: ?010? - data accepted ?101? - data rejected due to a crc er ror. ?110? - data rejected due to a write error. 4.10.13 data tokens read and write commands have data transfers associate d with them. data is b e ing transmitted or received via data tokens. all data bytes are transmitted msb first. data tokens are 4 to (n + 3) bytes long (where n is the data block len g th set using the set_block_lengt h command) and have the following f o rmat : - first byte: start byte token t y pe trans action t y pe 7 bit position 0 start b l o c k single block rea d 1 1 1 1 1 1 1 0 start block multiple block re ad 1 1 1 1 1 1 1 0 start b l o c k single block w r i t e 1 1 1 1 1 1 1 0 start block multiple block write 1 1 1 1 1 1 0 0 stop tran multiple block write 1 1 1 1 1 1 0 1 figure 4-12 data tokens - bytes 2 ? (n + 1) : user data - last two bytes: 16 bit crc. 4.10.14 data error token if a read operation fails and the card cannot provide the required data, it will send a data error token instead. this token is o ne byte long and has the following fo rmat:
multimediacard tm 60 figure 4-13 data error token the 4 least significant bits (lsb) are the same error bits as in the response format r2. 4.10.15 clearing status bits as descr ibe d in the pre v ious parag raphs, in s p i mode, st atus bit s ar e reported t o the ho st in three different for m ats : respo n se r1, response r2 a nd data erro r token (the same bits may exist in multiple response types ? e.g. c a rd ecc failed) as in the multimediacard mode, error bit s are cleared when read by the host, regardless of the response for m at. s t ate indicators ar e either clea red by reading or in accordance with the card st ate. all error/s t atus bit s define d in multimediacard mode, with th e exception of the und errun and o v errun, have the sa me meaning and usage in spi mo de. the following t able summarizes the set an d clea r condition s f o r the various st atus bit s : - t y pe: e: error bit. s: status bit. r: detected and set for t he actual co mmand resp onse. x : detected and set during comman d execution. the host must poll the card by sending status co mmand in order to read t hese bit s . - clear condition: a : accordin g to the card state. c: clear by read. spi mode status bits i d e n t i f i e r i n c l u d e d i n resp t y p e v a l u e des c ription c l e a r conditi on out of range r2 dataerr e r x ?0? = no error ?1? = error the comma nds argument was out of allow ed range for this card. c address error r1 r2 e r x ?0? = no error ?1? = error a address which did not match the block le ngth was used in the command. c erase sequence error r1 r2 e r ?0? = no error ?1? = error an error in the sequence of erase command sequen ce. c error param r2 e x ?0? = no error ?1? = error an error in the parameters of erase commands occurr ed. c parameter error r1 r2 e r x ?0? = no error ?1? = error an error in the parameters of the command. c wp violatio n r2 e r x ?0? = not protected ?1? = protect e d attemp to program a write protected block. c com c rc r1 r2 e r ?0? = no error the crc check of the pr evious c
multimediacard tm 61 error ?1? = error command fa iled. illegal command r1 r2 e r ?0? = no error ?1? = error command not legal for t he card state. c card ecc failed r2 dataerr e x ?0? = success ?1? = failur e card internal ecc was applied but failed to correct the d a ta. c cc error r2 dataerr e r x ?0? = no error ?1? = error internal card controller er ror. c e r r o r r 2 daraerr e r x ?0? = no error ?1? = error a general or an unknown error occurred du ring the ope ration. c wp erase skip r2 s x ?0? = not protected ?1? = protect e d only partial address spa c e was erased due t o existing w p blocks. c lock/unloc k command r2 e x ?0? = no error ?1? = error sequence o r password error during card lock/unlo ck operation. c card is locked r2 daraerr s x ?0? = card i s not locked ?1? = card i s locked card is locked by password. a erase retest r1 r2 s r ?0? = clear ed ?1? = set an erase se quence was cleared before exciting because an output of er ase sequen ce command was received. c in idle state r1 r2 s r ?0? = card is ready ?1? = protect e d the card en ters the idle state after power up or reset command. it will exit this state and become ready upon completion of this in itial i z ation procedures. a csd over w r ite r2 e x ?0? = no error ?1? = error the host is t r ying to change the rom sectio n, or is tryin g to reserve the copy bit (set as original) or p e rmanent wp bit (unprotecte d) or the csd register. c 4.11 spi bus ti ming all timing diagrams use the following schematics and abbreviations: h signal is h i g h (logica l ?1?) l t r ansmitter bit (host = ?1?, card = ?0 ?) x one-cycle pull-up (= ?1?) z high impedance st ate (- > = ?1?) * r e p e t i t i o n b u s y b u s y t o k e n c o m m a n d c o m m a n d t o k e n r e s p o n s e r e s p o n s e t o k e n dat a block dat a token
multimediacard tm ? host com m and to card response - card is read y figure 4-14 t i ming diagram of command / respon se tr a n sac tion, ca rd is read y the followin g timing dia g ram describes the basic command response (n o dat a) spi t r ansaction . ? host com m and to card response - card is bus y the followin g timing diagram describes the command response transact i on for commands whe n the card response is of type r1b (e.g. set_write_prot and erase). wh en the card is signaling busy , the host may d e select it (b y raising the cs) at an y time. the card will rel ease the dat a out line one clock af ter the cs going high. t o check if the card is still busy , it needs to be resele cted by asserting (set t o low) the cs signal. the card wil l resume busy signal (p ulling dat a out low) one clock af ter t he falling e d ge of cs . figure 4-15 t i ming diagram of com m and / resp onse tr ans a c tion, card i s bus y ? ca rd res ponse to host command figure 4-16 t i ming diagram: card re spons e to th e next ho st c o mmand ? single bl ock read 62
multimediacard tm f i g u r e 4 - 1 7 t i ming diagram: single block rea d tra n sac tion ? multiple block read - s t op t r ansmission is sent bet w e en blocks the timing for de-asse rting the cs signal af ter the last card respon se is identical to a st andard command/ response tra n saction figur e 4 - 18 t i ming diagram: multiple block tr an sa ction, s t op tr ansmis sion does n o t ov erlap d a t a ? multiple block read - s t op t r ansmission is sent within a block in an open-ended (or host aborted) multiple blo ck read tran saction the stop transmission command may be sent asynchronously to the dat a transmitted out of the card and may o v erlap the dat a block. in this case the ca rd will stop sending the dat a and transmit the response token as well. the delay b e tween command a nd response is st andard ncr clocks. the first byte, howe v er , is not guaranteed to be all set to ?1?. the card is allowed up to two clocks to sto p dat a transmission. the timing for de-asse rting the cs signal af ter the last card respon se is identical to a st andard command/ response tra n saction f i gure 4-19 t i ming diagram: mu ltiple block transa ction, s t op tran smission ov erla p s dat a ? reading the csd reg i ster the followin g timing dia g ram describes the send_cs d command bus transaction. the time-out values between the response a nd the dat a block i s ncx (since the nac is still unknown). 63
multimediacard tm 64 figu re 4-2 0 t i ming diagram: rea d csd r e gister ? single blo ck w r ite the host may deselect a card ( b y raising the c s ) at any time during t he card busy period (ref e r to the given timing diagram). the card will release the dat a out line one clock a f ter the cs going high. t o check if the card is still busy it needs to b e resele cted by assertin g (set to lo w) the cs signal. the card will resume busy signal (pull i ng dat a out low) one cl ock cycle af t e r the falling edge of cs. figure 4-20 t i ming diagram : single block w r ite ? multiple block w r ite the timimg behaviour o f the multip le block writ e transact i o n st arting fr om the comamnd up to the f i rst dat a block is identical to the single b l ock write. fi gure 63 describes the ti ming between the dat a blocks of a multiple block write tr ansaction. t i ming of the ?s top t r an? token is id e n tical to a st andard dat a block. af ter the ?s t op t r an? token is received ny the ca rd, the dat a on the dat a out line is u ndefined for one byte (nbr), af ter which a busy token may apear . the host may deselect an d reselect t he card during every busy period between the dat a blocks. t i ming f o r toggling the cs signal is identical to the single block write transa c tion. f i g u r e 4 - 2 1 t i m i n g d i a g r a m : m u l t i p l e b l o c k w r i t e t i ming v a lues m i n m a x u n i t n c s 0 8 8clo c k cycl e s n c r 1 8 8clo c k cycl e s n c x 0 8 8clo c k cycl e s n a c 1 (10/8 ) *(t aac*fo p+1 00* nsac) 8clo c k cy cl es n r c 1 8 8clo c k cycl e s n w r 1 8 8clo c k cycl e s n e c 0 8 8clo c k cycl e s
multimediacard tm 65 n d s 0 8 8clo c k cycl e s n b r 1 1 8clo c k cycl e s 4.12 error handling multimediacards are def ined as erro r free device s or a s devices with a d e fined maximum bit error rat e (with extern al error correction circu i try). to correct def ects in the me mo ry field of th e cards the system may include error correction code s in the payload data (ecc). this correction is int ended to co rrect static error s . additionally two methods of detect i n g errors gen erated durin g the data tr ansfer (dynamic errors) via a cyclic redundancy check (crc) are i m plemented . 4.12.1 error corre ction code (ecc) the multime d iacard is fr ee of static errors. all er rors are covered inside t he card, even errors occurring during the lif etime of multimediacard are covered for the user . the only effect which may be notifie d by the end use r is, that the overall memory capacity may be reduced by small number of blo cks. all fla s h handling is done on car d , so that no external error correction is needed. 4.12.2 cy clic red undanc y check (crc) the intentio n of the ecc method is to protect t he multimediacard against permanent storage failur e s in the memory field of t he card. to protect the data against errors generated during the transport over the multimediacard bus dynamically, an additional feature is implemented: the cyclic redun dancy check (cr c ). followin g the multimediacard standar d, th e multimediacard uses two differe nt crc codes to protect the data and the command/resp onse transfe r between card and host. unlike the ecc, the crc is intended only to detect transfer errors and not to correct them ?on the fly?. when a crc error is detected the host has to react. this is n o rmally don e by repeati ng the last command. t he first crc code is intended to protect the command and response fr ames. they are also used to synchronize the data str eam. one crc is checked in the multime d iacard for every command. for each response a crc is g enerat e in the multimediacard. each data block read from the multimedia c ard will be succeede d by redundancy bits generated with the second crc. both crcs are mandatory for the card and the host. ? crc7 the crc7 check is used for all com m ands, for all re sponses except type r3, and for the csd an d cid registers. the crc7 is a 7-bit va lue and is computed as follows: generator polynomial: g(x) = x7 + x3 + 1 m(x) = (first bit) * xn + (second bit) * xn-1 +...+ (last bit) * x0 crc[6...0] = remainder [(m(x) * x7)/ g(x)] all crc registers are initialized to zero. the first bit is the most lef t bit of the corresponding bit str i ng (o f the comman d , response, cid or csd). the degree n of the polynomial is the number of crc prot ected bit s decreased by one. the number of bit s to be protected is 40 for commands and re sponses (n = 39), and 120 for the csd an d cid (n = 1 19). ? crc16 the crc16 is used for p a yload pr otection in block transfer mode. the crc check sum is a 16-bit value and is computed as follows:
multimediacard tm 66 generator polynomial: g(x) = x16 + x12 +x5 + 1, m(x) = (first bit) * xn + (second bit) * xn-1 +...+ (last bit) * x0 crc[15...0] = remainder [(m(x) * x1 6) / g(x)] all crc registers are init ialized to ze ro. the first bit is the first dat a bit of the corresp onding block. the degree n of the polynomial denotes the number of bit s of the dat a block decrea s ed by one (e.g. n = 4095 for a b l ock length of 512 bytes). the gener ator polyno m ial g(x) is a st andard ccitt polynomial. the code h a s a minimal dist ance d=4 and is used for a p a yload length of up to 2048 bytes (n <= 16383).


▲Up To Search▲   

 
Price & Availability of MC2DU128HACA

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X